![]() |
Excluding Posts Except From Specific Category
Guys, posting this in general, its a code based question. If anyone can throw a possible solution at it, that would be great.
I am trying to change this code to only display from category 5 (exclude categories 1,2,3,4) and only allow 10 posts from it. Just seeing if anyone can tell me what to edit, I tried a few things, that did not work. Here is the code for anyone that may think they can get it to work. I am assuming the edits need to be done on line 14 or 16? Code:
<?php get_header(); ?> |
Re: Excluding Posts Except From Specific Category
Hi,
Use query_posts to modify the database query (ie to modify the normal Loop). Add this: Code:
<?php query_posts("cat=5&showposts=10"); ?>Code:
<?php if (have_posts()) : ?> |
Re: Excluding Posts Except From Specific Category
Adew, worked like a champ, thank you very much.
|
Re: Excluding Posts Except From Specific Category
Cool! :)
|
| All times are GMT -5. The time now is 05:45 AM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.