Well, if there isn’t such parameter listed in the Codex… it means it doesn’t exist.
I’m not certain I understand the question. What do you mean by “exclude categories”, exactly? How does that that relate to the get_archives function?
Thread Starter
SgrWd
(@adamf24)
Well get_archives will list the most recent posts. What I am asking is if you can set the get_archives function to list the most recent posts, but exclude any recent posts that fall under a category I wish to exclude from listing.
No, you can not.
Use a recent_posts gizmo (plugin, widget, etc.) for that.
Well get_archives will list the most recent posts.
No, it doesn’t. get_archives (and wp_get_archives) produce a list of links to the archive pages. Like the monthly archives and such.
http://codex.wordpress.org/Template_Tags/wp_get_archives
I guess that’s why I’m confused, you’re apparently using the wrong terminology here. Either that, or you are very specifically talking about the “postbypost” type. In which case, read moshu’s answer above. You could possibly do it with a custom filter on ‘getarchives_join’, but frankly it’d be simpler to use get_posts and write a simple loop instead.
im facing the same problem. i list a monthly archive. AFTER I click a month in my archive list, it will display the entries I made in that month. I want to exclude a certain category from those results.
i would have used
<?php if ( in_category(17) ) {
echo ' <div style="display: none;">';
}
?>
but i still actually want that category of entries to appear for “daily” archives.
This is actually pretty easy, and the answer is in the codex…
after the “if(have_posts():…the_post();” just add:
if(in_category(‘NUMBER HERE’)) continue;
That’s all there is to it.
Hi i have the same problam
im facing the same problem. i list a monthly archive. AFTER I click a month in my archive list, it will display the entries I made in that month. I want to exclude a certain category from those results.
i would have used
<?php if ( in_category(17) ) {
echo ‘ <div style=”display: none;”>’;
}
?>but i still actually want that category of entries to appear for “daily” archives.
the solution here is looking best but i donot know How to use these codes
<?php if ( in_category(17) ) {
echo ' <div style="display: none;">';
}
?>
and
if(in_category('NUMBER HERE'))
Thank you in advance…