WordPress category_name array for archive
-
I want to add a 2nd blog to my website, so I want the first blog to only show certain categories. This code will only show catacory ‘fotoblog’:
$cat = ('fotoblog'); $arguments = wp_parse_args( array( 'orderby' => 'date', 'order' => 'DESC', 'posts_per_page' => 10, 'paged' => $paged, 'pagename' => '', // reset page template to behave like archive 'category_name' => $cat, 'extend' => true ), $wp_query->query);
So basically I was trying to use $cat variable as an array. But this isn’t working for me:
$cat = array ("fotoblog", "name2", "name3");
Any suggestions? Thanks.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘WordPress category_name array for archive’ is closed to new replies.