Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

WP 3 Question - How to use the blog for just one category WordPress

  • SOLVED

I am working on a WP 3 driven site and what I'm trying to do is use the "Posts" functionality to control different pages.

I have 3 categories, news, events and mixes and I have used category-X.php files to control the events and mixes pages. When I want to do is use WP blog capabilities (index, archive and single) ONLY for the news category (not for events and mixes).

Can this be done with the new loop capabilties or do I need to get dirty with queries.

If anyone is providing code answers then the news category id is "4".

PS. here is a link to the site in progress news category : [[LINK href="http://floorplay.gunkdesign.co.uk/news"]][[/LINK]]

Answers (3)

2010-11-12

Merne Asplund answers:

you can just change your query in your index, archive, and single. Add this above your loop if a query posts isnt already there. Change the "News" part to whatever you called it.

<?php query_posts('category_name=Staff Home'); ?>



<strong>ALSO</strong> If you want to use your cat ID:

<?php query_posts('cat=4'); ?>

2010-11-12

Joe Jenkins answers:

In your code on either index.php or home .php, you will find the following:

WP_Query("

You may have something further in there, such as:

WP_Query("showposts=10")

That number could be anything.

What you need to do is the following:

WP_Query("cat=XXX")

the XXX would be the category ID you wish to use.

If there is soemthing else in there, then do it as folows:

WP_Query("showposts=10&cat=XXX")

2010-11-12

Cosmin Popovici answers:

You just need to delete your category-news.php file.

That way, News will be displayed with the standard index.php or category.php or archive.php, while the other categories will still have their own templates.