Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages »

Restrict posts on index to a specific category.


  #1  
Old Feb 17, 2010, 03:37 PM
amish_geek
 
1 posts · Feb 2010
Is it possible to only have the posts on the index page be from a single category (ie 'News') while posts in other categories are reached through the category navigation?
  #2  
Old Feb 17, 2010, 04:08 PM
paulae's Avatar
paulae
 
1,333 posts · Feb 2009
Wordpress 3.4.1, Atahualpa 3.7.7
You can do this with PHP. Flynn helped me out when I wanted to show posts from all categories on the front page EXCEPT from 2 categories, Obituaries and Letters to the Editors. I wanted them to show only in the left sidebar as separate "Recently In....." widgets.

I put this in the Style and Edit Center Column/Content Above the Loop section:
Code:
<?php if (is_front_page() && !is_paged() )
     $posts = query_posts($query_string . '&cat=-15,-80'); ?>
The -15 and -80 means "don't show posts from these categories". The clunky way to do what you want would be to put all of your categories EXCEPT the one you do want in there with the minus sign. The elegant way would be with the proper PHP code.
  #3  
Old Feb 17, 2010, 04:13 PM
lmilesw's Avatar
lmilesw
 
10,174 posts · Jul 2009
Central New York State USA
Another possibility is to use the Sticky Front Page Categories and Tags plugin or the Opt-in Front Page plugin which allows the blog or news category to show as you wanted.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.

Last edited by lmilesw; Feb 17, 2010 at 04:16 PM.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] post-specific header image w/ css insert (page-specific ones work, but not o viewdesigninc Header configuration & styling 10 Oct 1, 2012 03:43 PM
Hiding a category from index : success but posts unreachables vil2 Excerpts, Read more, Pagination 2 Jan 24, 2010 03:41 PM
[SOLVED] On certain page only posts from specific category RijnmondE4 Page & Category Menu Bars 3 Nov 17, 2009 03:13 PM
Restrict front page to showing sticky posts only DougBarned Atahualpa 3 Wordpress theme 4 Nov 13, 2009 01:28 PM
No Index No Follow meta tag for specific pages kylen20 Excerpts, Read more, Pagination 2 Sep 28, 2009 03:44 AM


All times are GMT -6. The time now is 10:55 AM.


Powered by vBulletin® Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.