weruncompanies
Power Member
- Feb 15, 2011
- 605
- 287
Thanks all, fixed now.
Last edited:
You can use a negative category value to exclude any given category_id from the loop, as follows
Code:<?php if (!is_paged() and is_home()) { query_posts('cat=-519'); wp_reset_query();
...which excludes posts from the category id 519 from showing
I know u said u tried in functions.php but take a look at this snippet http://wp-snippets.com/exclude-category-from-homepage/
So where do I put this? And what about the $i=1 part?
query_posts('cat=-519');
&cat=-519
cat=-519
Well the $i=1 has nothing todo with any of the code you have posted, must be part of the theme or such... All you need to exclude cats is...
Code:query_posts('cat=-519');
..replacing 519 with the correct ID, so easiest means would be to edit your themes index.php and look for the query_posts command and addto it if it already contains a string, otherwise useCode:&cat=-519Code:cat=-519
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts('posts_per_page=10&paged='.$paged);
?>
<?php $i=1; if (have_posts()) : ?>
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_postsquery_posts('cat=-519');
?>
<?php $i=1; if (have_posts()) : ?>