Try:
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args= array(
'cat' => -12,-34,-56,
'paged' => $paged
);
query_posts($args);
?>
Esmi-
That worked beautifully! The older posts functionality works. One small issue, the second category exclusion (category 1660 in my case), is no longer working. It’s curious because the first exclusion is. Here is the code I have in place:
<?php
$paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
$args= array(
‘cat’ => -675, -1660,
‘paged’ => $paged
);
query_posts($args);
?>
Update:
The second category (1660, Production) is still not being excluded succesfully.
In addition, my search feature is no longer working. I made 2 changes since it last worked, the above edit and the installation of a plugin (Subscribe2). I deactivated Subscribe2 and the problem remained, so I am confident it has something to do with the above edit.
As a reminder my URL is:
http://www.derangeddiaries.com
Thanks in advance for helping me out!
Again, the search function is not working on the site since I made the above modifications. Any ideas on how to have my cake and eat it too (keep the older posts work, and fix the now broken search function).
Thanks in advance, this whole community rocks!
try and use
'category__not_in' => array(675, 1660),
instead of
'cat' => -675, -1660,
this should exclude the second category as well; however, this will not help with the search error.
to have the search working, you:
either have go back to try Otto’s fix with using $query_string;
or make a copy of index.php and save it as search.php – without the extra code.
—
assuming that you want to exclude the categories as well for search results:
the fix with $query_string:
– remove the other code;
– add this instead:
<?php global $query_string; query_posts( $query_string . '&cat=-675,-1660'); ?>