【Blogger/QooQ】注目記事:リンクをガジェット全体に変更

2020-12-18

Blogger プログラミング

B!

ちなみにガジェットの追加/削除を行うとコードがリセットされますので再度編集してください。
移動だけではリセットされません。


フリーのBloggerテンプレート「QooQ」のカスタマイズについてまとめています。
参考程度に。

尚、カスタマイズはバックアップを取った上、自己責任で行うようにしてください。





CSSの変更

h3タグだけではなく、全体にリンクをかけるので簡易的に。コメントはお好きに。
文字の色はリンク色がいい!って人は「font.color」を変更するか、
pとh3で別途分けるなど自由。

元のcss

.post-summary h3 a{
	color	: $(font.color) !important;
}

修正後のcss

/* *****************************************************************************
		注目の投稿 ガジェット
***************************************************************************** */
.post-summary a {
	color	: $(font.color) !important;
}

htmlの変更

全体にまるっとかかるようにaタグの位置を変更、h3タグの上についてるaタグは削除。

元のhtml

        <b:includable id='content'>
  <div class='post-summary'>
    <b:if cond='data:showPostTitle and data:postTitle != &quot;&quot;'>
      <h3><a expr:href='data:postUrl'><data:postTitle/></a></h3>
    </b:if>
    <b:if cond='data:showSnippet and data:postSummary != &quot;&quot;'>
      <p>
        <data:postSummary/>
      </p>
    </b:if>
    <b:if cond='data:showFirstImage and data:postFirstImage != &quot;&quot;'>
      <img class='image' expr:src='data:postFirstImage'/>
    </b:if>
  </div>

  <style type='text/css'>
    .image {
      width: 100%;
    }
  </style>
</b:includable>

修正後のhtml

<b:includable id='content'>
<div class='post-summary'>
	<a expr:href='data:postUrl'>
		<b:if cond='data:showPostTitle and data:postTitle != &quot;&quot;'>
			<h3><data:postTitle/></h3>
		</b:if>
		<b:if cond='data:showSnippet and data:postSummary != &quot;&quot;'>
			<p><data:postSummary/></p>
		</b:if>
		<b:if cond='data:showFirstImage and data:postFirstImage != &quot;&quot;'>
			<img class='image' expr:src='data:postFirstImage'/>
		</b:if>
	</a>
</div>
<style type='text/css'>.image {width: 100%;}</style>
</b:includable>



ブログランキング・にほんブログ村へ

Translate

魔王と愉快な仲間

このブログを検索

ラベル

ブログ アーカイブ

メッセージ

名前

メール *

メッセージ *

Powered by Blogger.

フリー写真素材ぱくたそ

QooQ