Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Brandon Kraft

    (@kraftbj)

    Code Wrangler

    What have you tried already? I’d suggest checking out https://codex.wordpress.org/Pagination , but any generic resource regarding taxonomy pagination should apply.

    Thread Starter Panos_M

    (@panos_m)

    Hi Brandon,

    thank you for your help. You were right in the codex is the answer. With the above code works fine

    function my_post_queries( $query ) {
      // do not alter the query on wp-admin pages and only alter it if it's the main query
      if (!is_admin() && $query->is_main_query()){
    
        // alter the query for the home and category pages 
    
        if(is_tax('job_listing_category')){
          $query->set('posts_per_page', 5);
        }
    
      }
    }
    add_action( 'pre_get_posts', 'my_post_queries' );

    Best Regards,
    Panos

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add pagination to taxonomy-job_listing category’ is closed to new replies.