2025年5月28日水曜日

[Blogger]特定のラベルで投稿日を非表示にする

<b:if cond='!data:post.labels any (l => l.name == "YOUR_LABEL")'>
<data:post.date/>
</b:if>

.post-labels a[href*="label/YOUR_LABEL"] + .post-timestamp,
.post-labels a[href*="label/YOUR_LABEL"] ~ .post-timestamp {
display: none !important;
}

<b:if cond='!data:post.labels any (l => l.name == "Label1" || l.name == "Label2")'>
<data:post.date/>
</b:if>

Hide dates for certain label blogger - Blogger Community
https://support.google.com/blogger/thread/346072144/hide-dates-for-certain-label-blogger

メモ

一番上が ラベル名: YOUR_LABEL を除いて投稿日を表示
(テンプレートの <data:post.date/> を置換)

次がCSSで ラベル名: YOUR_LABEL で投稿日を非表示にする方法

最後が複数のラベル Label1, Label2 を除いて投稿日を表示
(テンプレートの <data:post.date/> を置換)

日付を隠すのは正直使いどころが難しいですが
(最初から全部隠してしまうのが一般的かなと思うので)
特定のラベルで何かを表示させたり、非表示させたりするのには使えそうですね

追記

Add this CSS (replace "your-label" with your actual label name):
/* Hides date for posts with label "your-label" */
.label-your-label .date-header { display: none; }

これでできる様です

F(uriouz)

欲しいものリスト / 優先度の高いほしいものリスト / ☕を奢る
Donate 寄付 カンパ サポート Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.
詳細プロフィールを表示

0 comments:

スパム対策の為コメントをオフにしています。
Disqusは利用出来ます。

注: コメントを投稿できるのは、このブログのメンバーだけです。

...

Recent Posts

 
"The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License."