Filter Category from wp_get_archives
-
Hi!
I’m trying to filter a specific category from the list that is returned using wp_get_archives();
In my functions.php file, I’ve currently got a bandaid measure:
function my_archives_filter($where_clause) { return "WHERE post_excerpt != '' AND post_status = 'publish'"; } add_filter('getarchives_where','my_archives_filter');
This filters out the category I want discounted, but only because that specific category usually never has excerpts… hardly an ideal solution.
If this were an older version of WP, I suppose I’d use “post_category”… I don’t think downgrading is an option in this case. I’m stumped as to what I should do. I’d like to avoid plugins. Any suggestions? Thanks!
- The topic ‘Filter Category from wp_get_archives’ is closed to new replies.