Hello there, great theme! I’ve had no problems as of yet and I’ve done quite a bit with it so far!
However I am stuck. My site has a expired tag that we use to hide posts on category pages that have this expired tag.
We used something like this on our old theme to hide specific tagged posts from category / loop.
$exclude_tags = array(6725);
$wp_query->set(‘tag__not_in’,$exclude_tags);
However I cannot get it to work on this theme.
Can an admin help me out here?
Thanks!
Hi,
The theme uses different arguments than the ones wordpress uses and the so you would have to consider that, you can find the function here: http://screencast.com/t/XQSUUzLOXp6
Thanks
I added:
‘tag__not_in’=> ‘6725’,
to
‘category_ids’ => ”,
‘category_id’ => ”,
‘tag_slug’ => ”,
‘sort’ => ”,
‘limit’ => ”, /*’limit’ => 5,*/
‘autors_id’ => ”,
‘installed_post_types’ => ”,
‘posts_per_page’ => ”,
‘offset’ => ”,
‘live_filter’ => ”,
‘live_filter_cur_post_id’ => ”, //this is auto generated by the block render ( add_live_filter_atts ) only when it’s needed – it’s the current post id
‘live_filter_cur_post_author’ => ” //auto generated – author_id of current post
Still no luck with having those expired tagged posts being removed from category.
-
This reply was modified 11 years by
SaL.
Hi,
Try this: http://screencast.com/t/yUVJMSwbvII
add_action( 'pre_get_posts', 'exclude_posts' );
function exclude_posts( $query ) {
$exclude_tags = array(32);
if(is_category()) {
$query->set('tag__not_in',$exclude_tags);
}
}
Thanks