How to hide posts with a certain mark from the blogger homepage

Asked

Viewed 168 times

0

I have some posts that are just javascript, and on the home page appears javascript, I would like to hide posts that contain the tag "Hide" from the home page, what to do?.

I tried to change it: <b:include data='post' name='post'/>
So that’s why:

<b:if cond='data:blog.url == data:blog.homepageUrl'>
    <b:loop values='data:post.labels' var='label'>
        <b:if cond='data:label.isLast == "true"'>
            <b:if cond='data:label.name != "LabelYouWantToHide"'>
                <b:include data='post' name='post' />
            </b:if>
        </b:if>
    </b:loop>
<b:else/>
    <b:include data='post' name='post' />
</b:if>


I also tried the content of this page.

    <b:with var='posts'
            value='data:posts filter
                   (p => p.labels none
                         (l => l.name == "hide-me"))'>
    </b:with>

But this hides the post even on the page of the post itself.

1 answer

0


Find: <b:include data='post' name='post'/> and trade for:

<b:if cond='data:blog.url == data:blog.homepageUrl'>
  <b:if cond='data:post.labels none ( l => l.name == "Esconder" )'>
    <b:include data='post' name='post'/>
  </b:if>
  <b:else/>
  <b:include data='post' name='post'/>
</b:if>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.