Can't exclude Category from archive.php
-
Hello all
I’m trying to exclude a category from being loaded in the author archives. According to the WP Codex and many other websites, I’m to add the line
<?php query_posts('&cat=-42'); ?>before the
<?php while ( have_posts() ) : the_post();?>part to make sure this happens. Yet every time I do that, ALL posts are loaded into the archive, no matter if they’ve actually been written by the chosen author or not. If I try something like<?php while ( have_posts('&cat=-42') ) : the_post();?>or just leave the ampersand out, it doesn’t work either – it just displays no articles at all.
What am I doing wrong? I can’t find any mistake. 🙁
Thanks for your help!
The topic ‘Can't exclude Category from archive.php’ is closed to new replies.