Support » Fixing WordPress » How to alter the original query arguments, before the $wp_query is created

  • Resolved Darsain


    (search didn’t help me, if you know about post solving this issue, please link)

    Problem: I have a custom taxonomy loading taxonomy-{$taxonomy}.php template, and it works as expected -> paginating by the value of get_option(‘posts_per_page’), but that’s the problem. I need to have a custom pagination values for each custom taxonomy.

    Creating a new $wp_query inside the template file doesn’t really help, because if my custom items_per_page value in a new query is lower than original posts_per_page, it results in 404 on pages bigger than max_num_page of original query, thus template file doesn’t even load.

    Thats why I need to alter the arguments creating the original wp_query for particular custom taxonomy.

    I’ve failed in finding any awesome hook that would make this issue a breeze 🙁

    Is there a way how to do this without hacking the core? Or perhaps a different way how to get the custom items_per_page value working properly without altering the original query?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to alter the original query arguments, before the $wp_query is created’ is closed to new replies.