Support » Fixing WordPress » Taxonomy template file

  • I have a file called taxonomy-genre.php which gets posts that are in a specific genre.

    The url looks like this

    http://site.com/blog/genre/drama

    It works fine. However it’s using the post limit set in wp-admin/reading-settings and I don’t want that. I always want to display a maximum of 12…

    So I add a query_posts(‘showposts=12’) but then it doesn’t filter the content correctly and doesn’t retrieve items from the custom post type.

    I’m wondering how to achieve this. Do I need a new WP_Query? If so where do I start?

    Thanks for any help

Viewing 1 replies (of 1 total)
  • You can merge your new argument with the ones from the original query like this:

    global $wp_query;
    query_posts(
       array_merge(
          $wp_query->query,
          array('posts_per_page' => 12)
       )
    );
Viewing 1 replies (of 1 total)
  • The topic ‘Taxonomy template file’ is closed to new replies.