0
votes

I have setup my Read related posts sections to show up 4 posts of the same category. Say, I've 7 Categories - cat1, cat2, cat3, cat4,...,cat7. I would like to exclude posts under cat6 and cat7 from showing up posts in the read related post section. Please suggest me any ideas on how to get this done.? Any help in this regard would be greatly appreciated. Thank you in advance.

Note: The wordpress theme i'm using is typology, which gives me option only to show up read related posts according to category but there is no option for excluding category.

2
Since Typology is a commercial theme, and related posts is not a core WP functionality, I'd suggest you pop over to Themeforest and ask your question there.Peter HvD

2 Answers

0
votes
$arg = array('posts_per_page'=>-1, 'orderby'=>'title', 'order'=>'asc', 'category__not_in' => array(6,7) );
$loop = new WP_Query($args); 
0
votes

Yes, we are using array of categories ID ( array(catID,catid) ), if you are confuse, there is an another way as below.

$arg = array('posts_per_page'=>-1,'cat' => -$categoryID );