Send different Categories to different blog pages in same site
-
Hi guys:
we had someone design a theme for a site, and he set it up so that only one category would go to a blog. However, we are running three blog lists on our site. The blog lists are Press, Military and Racing.
How can I set it up so that each category goes to the respective page?
Below is the code/** * do another filter, page "Press" only display the posts which category under "press" * and page "Hero Military" display all the posts but exclude the category "press" * */ // get category "press" $category_name = 'press'; $theCategory = get_term_by('name', $category_name, 'category'); $page_is = get_post_meta(get_the_ID(), 'page_is', true); if ( $page_is == 'press' ) { // "press" page only display the posts which category under "press" if ( $theCategory ) { $baseARGS['cat'] = $theCategory -> term_id; } } else { // "Hero Military" page display all the posts but exclude the category "press" if ( $theCategory ) { $baseARGS['category__not_in'] = $theCategory -> term_id; } } if ( isset($_POST['action']) && $_POST['action'] == 'get_posts' ) { require_once 'config.theme.php'; require 'ajax/ajax_get_blog.php'; }
- The topic ‘Send different Categories to different blog pages in same site’ is closed to new replies.