Home > Tutorial > Hide Certain Posts from Blogger Homepage
Hide Certain Posts from Blogger Homepage
Posted on Sunday, August 21, 2011 by android apps market for tablests
It took me forever to come up with this one. But judging from the length of the code I've posted here, you should be able to tell how hard it was to come up with this one. First thing first - I will be seriously pissed if you try to copy this post, I mean it.
Now, back to the actual post. It has been a popular question/request from many bloggers - how to hide some posts from appearing on Blogger homepage? And now, with the help of labelled filters, you can actually do so. In other words, by labelling your posts 'hide', you can actually hide your post from ever seeing the light of your home page. And -- you can still view the post if you click on your archive or that 'Older post' or 'Newer post' link, or by accessing the post page directly via its URL, among other ways.
Note: I've also included my other famous tweak - 'show date for each post' - in this tutorial. It was necessary. For those of you who have inserted the code to show date for each post from my previous tutorials (link here and here) and want to try this week's tutorial, kindly reverse the steps and remove the old tweak before attempting this week's tutorial.
Step 1:
Backup your template before attempting this tutorial. Next, find for your template's HTML.
In old layout: Go to Dashboard - Design - Edit HTML - Expand Widget Templates.
In new layout: Go to Dashboard - Template - Edit Template HTML - Expand Widget Templates.
Next, find and delete the following lines:
The lines to be deleted (ending portion)
Backup your template before attempting this tutorial. Next, find for your template's HTML.
In old layout: Go to Dashboard - Design - Edit HTML - Expand Widget Templates.
In new layout: Go to Dashboard - Template - Edit Template HTML - Expand Widget Templates.
Next, find and delete the following lines:
<!-- posts -->The lines to be deleted (starting portion)
<div class='blog-posts hfeed'>
<b:include data='top' name='status-message'/>
<data:defaultAdStart/>
<b:loop values='data:posts' var='post'>
<b:if cond='data:post.isDateStart'>
<b:if cond='data:post.isFirstPost == "false"'>
</div></div>
</b:if>
</b:if>
<b:if cond='data:post.isDateStart'>
<div class="date-outer">
</b:if>
<b:if cond='data:post.dateHeader'>
<h2 class='date-header'><span><data:post.dateHeader/></span></h2>
</b:if>
<b:if cond='data:post.isDateStart'>
<div class="date-posts">
</b:if>
<div class='post-outer'>
<b:include data='post' name='post'/>
<b:if cond='data:blog.pageType == "static_page"'>
<b:include data='post' name='comments'/>
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<b:include data='post' name='comments'/>
</b:if>
</div>
<b:if cond='data:post.includeAd'>
<b:if cond='data:post.isFirstPost'>
<data:defaultAdEnd/>
<b:else/>
<data:adEnd/>
</b:if>
<div class='inline-ad'>
<data:adCode/>
</div>
<data:adStart/>
</b:if>
<b:if cond='data:post.trackLatency'>
<data:post.latencyJs/>
</b:if>
</b:loop>
<b:if cond='data:numPosts != 0'>
</div></div>
</b:if>
<data:adEnd/>
</div>
The lines to be deleted (ending portion)
Step 2:
Copy and paste the following lines in place of the deleted lines in Step 1 - then click on 'Save Template':
The code in place (ending portion)
Copy and paste the following lines in place of the deleted lines in Step 1 - then click on 'Save Template':
<!-- posts -->The code in place (starting portion)
<div class='blog-posts hfeed'>
<b:include data='top' name='status-message'/>
<data:defaultAdStart/>
<b:loop values='data:posts' var='post'>
<b:if cond='data:blog.pageType == "index"'>
<script type='text/javascript'>var ssyby='<data:post.dateHeader/>';</script>
<div class='ssyby-date-outer2'>
<b:if cond='data:post.labels'>
<b:if cond='data:blog.url != "http://yoboy-testblog7.blogspot.com/search/label/labelhide2"'>
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.name != "hide"'>
<b:if cond='data:label.name != "labelhide2"'>
<b:if cond='data:label.name != "labelhide3"'>
<!-- enter additional conditional label codes here -->
<div class='date-outer'>
<h2 class='date-header'><span><script type='text/javascript'>document.write(ssyby);</script></span></h2>
<div class='date-posts'>
<div class='post-outer'>
<b:include data='post' name='post'/>
<b:if cond='data:blog.pageType == "static_page"'>
<b:include data='post' name='comments'/>
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<b:include data='post' name='comments'/>
</b:if>
</div>
<b:if cond='data:post.includeAd'>
<b:if cond='data:post.isFirstPost'>
<data:defaultAdEnd/>
<b:else/>
<data:adEnd/>
</b:if>
<div class='inline-ad'>
<data:adCode/>
</div>
<data:adStart/>
</b:if>
<b:if cond='data:post.trackLatency'>
<data:post.latencyJs/>
</b:if>
</div>
</div>
<!-- close additional conditional label codes here -->
</b:if>
</b:if>
</b:if>
</b:loop>
<b:else/>
<div class='date-outer'>
<h2 class='date-header'><span><script type='text/javascript'>document.write(ssyby);</script></span></h2>
<div class='date-posts'>
<div class='post-outer'>
<b:include data='post' name='post'/>
<b:if cond='data:blog.pageType == "static_page"'>
<b:include data='post' name='comments'/>
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<b:include data='post' name='comments'/>
</b:if>
</div>
<b:if cond='data:post.includeAd'>
<b:if cond='data:post.isFirstPost'>
<data:defaultAdEnd/>
<b:else/>
<data:adEnd/>
</b:if>
<div class='inline-ad'>
<data:adCode/>
</div>
<data:adStart/>
</b:if>
<b:if cond='data:post.trackLatency'>
<data:post.latencyJs/>
</b:if>
</div>
</div>
</b:if>
<b:else/>
<div class='date-outer'>
<script type='text/javascript'>var ssyby='<data:post.dateHeader/>';</script>
<h2 class='date-header'><span><script type='text/javascript'>document.write(ssyby);</script></span></h2>
<div class='date-posts'>
<div class='post-outer'>
<b:include data='post' name='post'/>
<b:if cond='data:blog.pageType == "static_page"'>
<b:include data='post' name='comments'/>
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<b:include data='post' name='comments'/>
</b:if>
</div>
<b:if cond='data:post.includeAd'>
<b:if cond='data:post.isFirstPost'>
<data:defaultAdEnd/>
<b:else/>
<data:adEnd/>
</b:if>
<div class='inline-ad'>
<data:adCode/>
</div>
<data:adStart/>
</b:if>
<b:if cond='data:post.trackLatency'>
<data:post.latencyJs/>
</b:if>
</div>
</div>
</b:if>
</div>
<b:else/>
<div class='date-outer'>
<script type='text/javascript'>var ssyby='<data:post.dateHeader/>';</script>
<h2 class='date-header'><span><script type='text/javascript'>document.write(ssyby);</script></span></h2>
<div class='date-posts'>
<div class='post-outer'>
<b:include data='post' name='post'/>
<b:if cond='data:blog.pageType == "static_page"'>
<b:include data='post' name='comments'/>
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<b:include data='post' name='comments'/>
</b:if>
</div>
<b:if cond='data:post.includeAd'>
<b:if cond='data:post.isFirstPost'>
<data:defaultAdEnd/>
<b:else/>
<data:adEnd/>
</b:if>
<div class='inline-ad'>
<data:adCode/>
</div>
<data:adStart/>
</b:if>
<b:if cond='data:post.trackLatency'>
<data:post.latencyJs/>
</b:if>
</div>
</div>
</b:if>
</b:loop>
<data:adEnd/>
</div>
The code in place (ending portion)
Step 3:
You're already done! To hide a post from your main page, just label it 'hide'. And it is very important NOT TO INCLUDE any other labels when you use the hiding label. That means, the hiding label should be the sole label for a post if you decide to hide it.
You can customize the label from 'hide' to a text of your own by changing line 14 in the code above. Enjoy folks!
You're already done! To hide a post from your main page, just label it 'hide'. And it is very important NOT TO INCLUDE any other labels when you use the hiding label. That means, the hiding label should be the sole label for a post if you decide to hide it.
You can customize the label from 'hide' to a text of your own by changing line 14 in the code above. Enjoy folks!
Show All Hidden Posts in Label Page
You might want to hide some of the posts from your home page, but show the posts when you click on the 'hide' label page, or whatever label name you choose for this purpose. To enable this, all you have to do is change the URL in line 12 in the code given in Step 2. You need to replace the URL above with the URL of your hiding-label page. You can find out the link to your hiding-label page by clicking on the hiding-label from your label's gadget. For example, if you decide to use the 'hide' label as your hiding-label (boy this sounds confusing, but it is not!), simply click on 'hide' from your 'Label' gadget and you shall get the address of your hiding-label page.
This will be useful if you intend to make use of the label page's URL to categorize your post. Let me just give you an example. At the top of this blog, in my menu, I have a link to my 'Transformers' posts. All the posts that have the 'Transformers' label are grouped there. Each time I use this label, the post will appear in that link, as well as my homepage. If I want these posts to just appear in the link in my tab, and not my homepage, all I have to do is change the label address in line 12 my 'Transformers' label address.
You might want to hide some of the posts from your home page, but show the posts when you click on the 'hide' label page, or whatever label name you choose for this purpose. To enable this, all you have to do is change the URL in line 12 in the code given in Step 2. You need to replace the URL above with the URL of your hiding-label page. You can find out the link to your hiding-label page by clicking on the hiding-label from your label's gadget. For example, if you decide to use the 'hide' label as your hiding-label (boy this sounds confusing, but it is not!), simply click on 'hide' from your 'Label' gadget and you shall get the address of your hiding-label page.
This will be useful if you intend to make use of the label page's URL to categorize your post. Let me just give you an example. At the top of this blog, in my menu, I have a link to my 'Transformers' posts. All the posts that have the 'Transformers' label are grouped there. Each time I use this label, the post will appear in that link, as well as my homepage. If I want these posts to just appear in the link in my tab, and not my homepage, all I have to do is change the label address in line 12 my 'Transformers' label address.
Margin Fix:
If something seems off with the way your posts are arranged in your homepage, fear not. Simply add the CSS code below and things will be fine again.
In default layout: Go to Dashboard - Design - Template Designer - Advanced - Add CSS - paste the following code - Press enter after the last character of the last line } - Apply to Blog.
In new layout: Go to Dashboard ('House' symbol) - Template - Customize - Advanced - Add CSS - paste the following code - Press enter after the last character of the last line } - Apply to Blog.
If something seems off with the way your posts are arranged in your homepage, fear not. Simply add the CSS code below and things will be fine again.
In default layout: Go to Dashboard - Design - Template Designer - Advanced - Add CSS - paste the following code - Press enter after the last character of the last line } - Apply to Blog.
In new layout: Go to Dashboard ('House' symbol) - Template - Customize - Advanced - Add CSS - paste the following code - Press enter after the last character of the last line } - Apply to Blog.
.ssyby-date-outer2 .date-outer {
position: relative;
margin-bottom: 65px;
}
.ssyby-date-outer2:last-child {
margin-bottom: -45px !important;
}Change the value '65px' accordingly.Took me forever to come up with this one. Simply the hardest tweak I've come up with. Hope you guys find it useful. Cheers.
Category Article Tutorial
Powered by Blogger.
Blog Archive
-
▼
2011
(4034)
-
▼
August
(97)
- August Reflections
- Forecast iPhone
- PrivyTalks – EncryptedAnonymous Chatting Online
- The Ultimate Top Ten - Blogiversary Edition
- 5 Google Products That Need tobe Integrated With G...
- The Sunday Salon: Week In Review #34
- Google suggests showdirect links in searchbar
- Apple Loses it Colossus: SteveJobs Quits as CEO
- Google Allows Sharing “+1″Links to Google+ Circles
- [Infographic] What HappensEvery 60 Seconds on the Web
- Google Plus gets Twitter likeVerified Sign for Cel...
- The Reading Promise
- Twenty Thousand Leagues Under the Sea
- The 21 Balloons
- Firefox Announces List ofSlow Performing Addons
- Get Incompatible FirefoxAddons Working in Aurora a...
- Online Tip – Avoid spam withdisposable E-mail account
- Create Disposable Email andKeep Track of Messages ...
- Windows 8 Will Change TheWay Copy-Paste is Done
- Library Loot: Third Trip in August
- Into the Parallel (YA)
- Sarahs' Ground (MG)
- How To BypassRapidshare WaitingTimes (Vital for Fr...
- What to do when anapplication you justinstalled do...
- Cool iPhone 4 Tricksand Tips
- What's On My Nightstand (August)
- Further Chronicles of Avonlea
- Huge (YA)
- Hide Certain Posts from Blogger Homepage
- Most CommonPowerPoint Problemsand Solutions
- Orkut Scraps
- The Sunday Salon: Week in Review #33
- Top 10 Best and Cool Computer Tricks
- 20 iPhone – Hacks, Tips and Tricks
- Notepad Tricks
- Samsung Galaxy S Tricks
- [$12.5 Billion]Google Buys Motorola to PowerAndroid
- 5 Reasons Why I Would NeverSwitch to Firefox
- Check Out the Redesigned NewTabs Page on Chrome
- Get Weather Reports Alongwith Google Maps
- The best Uninstaller forWindows – Revo Uninstaller...
- Library Loot: Second Trip in August
- The Railway Children (MG)
- [Survey] Top 10 Android AppsHog 43% of Time Spent ...
- The Story of the Treasure Seekers (MG)
- The Phoenix and the Carpet (MG)
- Venetia
- Five Children and It (MG)
- The Private World of Georgette Heyer
- Grapes of Wrath
- The Book of Dragons (MG)
- Browser Wars: Chromeis the Only Browser withGrowth
- Preview an Email BeforeOpening it on Gmail
- A Search Engine andDirectory forInfographics – Vis...
- Search for Public Postsand Profiles on Google+,Goo...
- Flip Through YourTwitter and FacebookUpdates Like ...
- AMD’s Fusion APUProcessors CombinesCPU & GPU
- [Online Tip] ManageSaved Passwords inGoogle Chrome
- Mass Invite Friends onGoogle+ by Sharing aLink
- 3 Free Online Tools toCheck if an EmailAddress Act...
- The Sunday Salon: Week In Review #32
- Samsung Galaxy ROfficially Announced forAsia, Euro...
- Twitter Adds ActivityFeature to Become aFacebook C...
- Read Your Kindle Bookson the Browser!
- Angry Birds are Flyinginto Google Plus
- Angry Birds are Flyinginto Google Plus
- [Rumour] Apple tounveil iPhone 5 onSeptember 7th
- [Rumour] Apple tounveil iPhone 5 onSeptember 7th
- How Google uses YOURGmail for Social Search
- Top Ten Rereads
- A Most Unsuitable Match
- From the Mixed-Up Files of Mrs. Basil E. Frankweiler
- Sunday Salon: Week in Review #32
- Removing Border and Shadow from Blogger Signature ...
- Library Loot: First Trip in August
- They Do It With Mirrors
- How To Enable orDisable Google InstantSearch
- Apple WorldWideDevelopers Conference –WWDC Live St...
- Copyright Free Images
- How to Start Windows7 in Safe Mode
- iPhone 5 – Release date,Rumors and Features
- Create Beautiful Retroand Vintage Effects inSeconds
- [Infographic] Quick Lookat ProgrammingLanguages
- 5 Best ChromeExtensions to TakeBeautiful Screenshots
- Enable Non-DropboxUsers Upload Files IntoYour Drop...
- Update Your Chrome toEnable Instant Pagesand Print...
- Enable AutomaticSharing of Google+ Postson Twitter
- The Boxcar Children
- Google Toolbar to beDumped! Joins CasualtyList wit...
- [Funny] What do Namesof Google+ CirclesActually Mean
- Create A Dashboard OfYour Favorite Links –Faveous
- 5 Tech CompaniesGoogle+ Could Put Out ofBusiness
- Disable Websites fromTracking You For BetterPrivacy
- Gmail Hints ThatHotmail, AOL and YahooAre Outdated
- 5 Reasons Google+ PartyContinues Even as TrafficDrops
- Listen And Share MusicOn Twitter – Twusic
- By His Own Hand?
-
▼
August
(97)






