Blogger: Filter posts by label on your main page
January 30th, 2010I spent quit a while phishing around google trying to figure out how to prevent posts with a certain label from appearing on my main page over at blogger/blogspot. Eventually, I used an adaptation of this method (also detailed here).
To applay this method, edit your blogger sites XML template (be sure to back it up first!), and click “Expand Widget Templates”. Now look for the line:
<b:loop values=’data:posts’ var=’post’>
And find the matching </b:loop> tag.
Replace them and everything between them with the following code:
<b:loop values=’data:posts’ var=’post’>
<b:if cond=’data:blog.url == data:blog.homepageUrl’>
<b:if cond=’data:post.labels’>
<b:loop values=’data:post.labels’ var=’label’>
<b:if cond=’data:label.isLast == "true"’>
<b:if cond=’data:label.name != “Label_To_Filter“>
<b:include data=’post’ name=’printPosts’/>
</b:if>
</b:if>
</b:loop>
</b:if>
<b:else/>
<b:include data=’post’ name=’printPosts’/>
</b:if>
</b:loop>
Now look for the last </b:includable> tag you can find, and paste this code directly after it:
<b:includable id=’printPosts’ var=’post’>
<b:if cond=’data:post.dateHeader’>
<h2 class=’date-header’>
<data:post.dateHeader/>
</h2>
</b:if>
<b:include data=’post’ name=’post’/>
<b:if cond=’data:blog.pageType == “item”‘>
<b:include data=’post’ name=’comments’/>
</b:if>
</b:includable>
Note that this code has a few bugs:
- Posts with no label will not be displayed on the main page.
- The filtered label must be the last label of a filtered post.
- If all your recent stories belong to the filtered category, your blog may appear empty.
I consider these “Features” as they suit my need over at www.luxphile.com – preventing any of my Texture labeled posts from showing up on the main page, and also hiding unlabeled “Blog this” posts from Flickr.






October 11th, 2008 at 8:20 am
If this works well. You might able to set up a windows in a vmplayer to do the job. All in one Linux box…. I have a friend have this printer, but he is a windows guy, won’t try this trick for me.
April 11th, 2009 at 1:59 pm
I’ve got the Xerox Phaser 6125 working on Ubuntu 8.10 64bits.
The trick is to install te printerdriver of the Fuji-Xerox DocuPrint C525.
The only problem is, that I can only print 1 page at the time, but there must be a solution, but where.