-
-
I’d like to exclude posts with a certain category from showing in the roll on the Full Blog widget. How can I do this?
-
Hello,
Are you referring to the “Latest posts” widget? Or the “Full Blog” element of Visual Composer? It is not possible filtering based on category in the first one. In the second, you can chose a category (go to Full Blog Settings > Set Headlines From Blog) but not exclude one.
Best regards!
-
Thanks for the reply.
I was actually looking to exclude certain categories from the Full Blog element of visual composer. I have 20 categories of posts, but I only want 19 to display.
I figured out how to this in code, however. I ported over /specular/vc_templates/home_blog.php to my child theme and then edited this line:
if($dynamic_from_where == 'all_cat') query_posts('posts_per_page='.(int)$posts_per_page.'&paged='.get_query_var( 'paged' ) ); else query_posts('posts_per_page='.(int)$posts_per_page.'&cat='.$dynamic_cat.'&paged='.get_query_var( 'paged' ) );
And you change it to this:
if($dynamic_from_where == 'all_cat') query_posts( array( 'posts_per_page='.(int)$posts_per_page.'&paged='.get_query_var( 'paged' ), 'cat'=>'-244' ) ); else query_posts('posts_per_page='.(int)$posts_per_page.'&cat='.$dynamic_cat.'&paged='.get_query_var( 'paged' ) );
‘244’ is the category ID of the category you’re looking to exclude.
-
Hello,
I am glad you found your solution. Thank you for sharing the edit.
Best regards!
-
You must be logged in to reply to this topic.