How To Hide Widgets on Multiple Related Posts using a conditional Tag?


#1

Hello,

Is there any code or condition to hide some of widget’s on posts that containing specific label or posts of specific author.?? i know i can use posts url in <b:if… condition but if i want to hide widget on 100 posts then 100 <b:if… conditions used… Please Help me in this case.


#2

There is no effective label tag yet available but yes you can use the author name to hide widgets on your blog posts. Use the following condition to hide or display HTML content on any page of your blog based on Author name

Hide Widgets for a Specific Author

<b:if cond='data:post.author != "Author Name"'>
Widget Code or HTML to hide 
</b:if>

Show Widgets for a Specific Author

<b:if cond='data:post.author == "Author Name"'>
Widget Code or HTML to hide 
</b:if>
  • Replace Author Name with your blog author Full name. Author names are case sensitive so used the exact letter case a sit appears on author’s articles.

#3

Try using this conditional tag, and may this tags solved your probs:

For specific posts/page:

<b:if cond='data:blog.url == &quot;Page URL&quot;'>
Code Here
</b:if>

For specific label:

<b:if cond='data:blog.searchLabel'>
Code Here
</b:if>

#4

After Using this Code:

 <b:if cond='data:post.author == "Aitazaz Ahsan"'>
     <meta content='Aitazaz' name='Author'/> 
</b:if>

Showing this Error:


#5

share your URL and please elaborate your problem so we’ll give you best solution