• Resolved betacire

    (@betacire)


    Thanks for this plugin very easy to use.

    Just one thing… is it possible to filter the sticky posts too ? I’ve hidden the category where this post is, but it still appears on the blog page.

    Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter betacire

    (@betacire)

    Ok.

    I changed the filterCategories function, and it seems to work like I want :

    	function filterCategories($query) {
    		if ($query->is_main_query() && is_home()) {
    			
    			$categoryList = array();
    			$allowed = get_option('blogPostFilterCategories');
    			foreach($allowed as $id=>$status)
    				if(!$status==1){
    					$categoryHidden[] = '-'.$id;
    				} 
    	        $query->set('cat', implode(',', $categoryHidden));
                    $query->set('ignore_sticky_posts', 'true');
    		}
    	}

    Thanks again for this plugin.

Viewing 1 replies (of 1 total)
  • The topic ‘sticky posts not filtered’ is closed to new replies.