- You first have to label all posts that you don't want to appear on the home page as
hide.
2.Then Go to Dashboard - Template - Edit Template HTML
3. Place the curser on the HTML page and click cntrl+F and search for <!-- posts -->(note that coding for post ends at the begining of the navigation code. Be sure to save your template before pasting the following code on the post coding)
4. Then highlight the post coding and paste the following code;
<!-- posts -->
<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-12.blogspot.com/search/label/hide"'>
<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='comment_picker'/>
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<b:include data='post' name='comment_picker'/>
</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>
</div>
<b:loop values='data:post.labels' var='label'>
<script type='text/javascript'>
var dhar = '<data:label.name/>';
if(dhar == "hide" || dhar == "label2"){
document.write("<div class='hide-climb'/>");
flag=flag*0;}
</script>
</b:loop>
</div>
<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='comment_picker'/>
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<b:include data='post' name='comment_picker'/>
</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>
</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='comment_picker'/>
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<b:include data='post' name='comment_picker'/>
</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>
</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='comment_picker'/>
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<b:include data='post' name='comment_picker'/>
</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>
</div>
</div>
</b:if>
</b:loop>
<data:adEnd/>
</div>
<script src='http://code.jquery.com/jquery-latest.js'/>
<script>
$('.hide-climb').closest('.ssyby-date-outer2').css('display', 'none');
</script>
5. For your posts to be hidden only on your homepage and show them in all other pages with other labels , copy paste the following code on the 10 th line of the above code.
<b:if cond='data:blog.url == data:blog.homepageUrl'>
This will make your posts to be hidden only on your homepage and show them in all other pages.
6. Save your template and you're done
No comments:
Post a Comment