How to hide author and post date and time from static page of blogger template


#1

Hi,

I have created 5 static pages for my blog for example [about us/privacy policy/ disclaimer/contact us/terms and condition]. However, these static page show author, date and time like regular blog posts. In this case, I would like to hide all these information from static pages and static page will show only headline of the page. Please give me a solution about this problem.

Screen shot: [http://prntscr.com/a9jsj6]

Thanking you.

Best regards.


#2

@ahmeddcc159

Thanks to join this forum.

Now comes to your Query. You have two option to Do this.

  1. Using CSS with conditional tags for Static Pages.
  2. Using Conditional Tags for static pages for each elements you want to hide (I recommend this method to be used, since it is SEO friendly).

First CSS Method

Paste below code above </head>

<b:if cond='data:blog.pageType == &quot;static_page&quot;'>
<style type='text/css'>
/* Static Page Style Goes Here */
</style>
</b:if>

You can specify rule for each element with property {display:none}. But i do not recommend this method to be used for hiding page elements from users. Because even if you have hide data from users, still it has been there and loads each time with page loads.

Second Method - Recommended

Find this in your Template <span class='post-author vcard'> upto closing </span> tag for this statement.

Now Wrap this statement in conditional tags as like follows.

<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<span class='post-author vcard'>
<b:if cond='data:top.showAuthor'>
<b:if cond='data:post.authorProfileUrl'>
<span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'>
<meta expr:content='data:post.authorProfileUrl' itemprop='url'/>
<a expr:href='data:post.authorProfileUrl' rel='author' title='author profile'>
<span itemprop='name'><data:post.author/></span>
</a>
</span>
<b:else/>
<span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'>
<span itemprop='name'><data:post.author/></span>
</span>
</b:if>
</b:if>
</span>
</b:if>

This is an example to hide author data from static pages.

To Hide date - Wrap data in conditional tags as follows.

<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<span class='post-timestamp'>
<b:if cond='data:top.showTimestamp'>
<data:top.timestampLabel/>
<b:if cond='data:post.url'>
<meta expr:content='data:post.canonicalUrl' itemprop='url'/>
<a class='timestamp-link' expr:href='data:post.url' rel='bookmark' title='permanent link'><abbr class='published' expr:title='data:post.timestampISO8601' itemprop='datePublished'><data:post.timestamp/></abbr></a>
</b:if>
</b:if>
</span>
</b:if>

You may hide data from static pages as per above example. Let me know via reply if you have any problem.

Thanks,

Robin Singh