php - How Display All Post on a Category Page in Wordpress -


i have categories name 'trending' , 'top' want display posts on both of these categories pages. don't want write custom query want edit "global $wp_query;" object , remove "cat" query display posts.

how possible?

my code snap:

    global $wp_query;     if (isset($wp_query->query_vars[$monstrotheme->settings->slugs->frontendposting->addnew])) {         $this->data['specialpage'] = 'frontend-submit';         $this->data['currentcontentlayout'] = 'page';     } else if ($wp_query->query_vars['pagename'] == $monstrotheme->settings->slugs->login->login) {         $this->data['currentcontentlayout'] = 'frontpage';     } else {         if (is_front_page() || is_404()) {             $this->data['currentcontentlayout'] = 'frontpage';         } else if (is_post_type_archive('gallery') || is_tax('gallery-category') || is_tax('gallery-tag')) {             $this->data['currentcontentlayout'] = 'galleryarchive';         } else if (is_post_type_archive('video') || is_tax('video-category') || is_tax('video-tag')) {             $this->data['currentcontentlayout'] = 'videoarchive';         } else if (is_archive() || is_search() || (is_home() && !is_front_page())) {             $this->data['currentcontentlayout'] = 'postarchive';             if (is_category('trending')) {                 // here want alter query             }         } else if (is_page()) {             $this->data['currentcontentlayout'] = 'page';         } else if (is_single()) {             switch (get_post_type()) {                 case 'video':                     $this->data['currentcontentlayout'] = 'video';                     break;                 case 'gallery':                     $this->data['currentcontentlayout'] = 'gallery';                     break;                 default:                     $this->data['currentcontentlayout'] = 'post';             }         } else {             exit;         }     } 


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -