0
Welcome Guest! Login
0 items Join Now

Blog category

    • MartiX's Avatar
    • MartiX
    • Jr. Rocketeer
    • Posts: 46
    • Thanks: 0

    Blog category

    Posted 9 years 5 months ago
    • Hi, where in Gantry 5 can I setup blog category at it was on Gantry 4?
      What I need is to exclude one category from blog page.

      Thank you.
    • Damir's Avatar
    • Damir
    • Preeminent Rocketeer
    • Posts: 22450
    • Thanks: 2679
    • Web Developer

    Re: Blog category

    Posted 9 years 5 months ago
    • Well currently you can't in admin panel, you can add a function to functions.php file and thats it your set just replace the ids with your category ids that you dotn want to show - ust be in front:
      function exclude_category( $query ) {
          if ( $query->is_home() && $query->is_main_query() ) {
              $query->set( 'cat', '-1,-1347' );
          }
      }
      add_action( 'pre_get_posts', 'exclude_category' );
    • Available for CUSTOM WORK with Joomla, WordPress and Grav Templates and Gantry Framework!

Time to create page: 0.073 seconds