From the Codex for pre_get_posts:
pre_get_posts cannot be used to alter the query for Page requests (page templates) because ‘is_page’, ‘is_singular’, ‘pagename’ and other properties (depending if pretty permalinks are used) are already set by the parse_query() method. See: Query Overview. The recommended way to alter the main query for page requests is to use new WP_Query in the page template itself.
So, I’d suggest seeing if new WP_Query ( http://codex.wordpress.org/Class_Reference/WP_Query ) could help you here.
Related Posts:
- How to filter, restrict and return posts based on custom user meta information
- WP_Query and DES sort for Custom Taxonomy based upon a meta field?
- How to add taxonomy filter on the query fly?
- Pagination custom query
- Order by two meta keys
- Finding all results from database within 500 miles of the given latitude and longitude [closed]
- Select posts wich has no relationship in custom taxonomy
- Shortcode returns escaped HTML tags
- Calling a custom excerpt function in a local loop
- Dynamically Override Fancy Title – Part II
- query posts in functions.php and update a field
- Filter and list posts of a custom taxonomy
- How to show only one post for each categories of taxonomy of custom post that contains a specific custom field
- How to Modify Taxonomy Archive Page with Search Parameter?
- Get array of current post term ID’s
- Display link to taxonomy archive only if it has posts with certain custom field values
- WP_Query, tax_query and term_meta: How to?
- posts_per_page not working
- Function get_queried_object() return NULL in custom taxonomy
- Getting Taxonomy inside WP_Query Loop
- How to delete taxonomy term when a wordpress user is removed?
- Exclude category for main query and custom
- Order posts by taxonomy count
- Query custom post type by custom taxonomy (category slug)
- WP Query using tax_query & meta_query
- WP_Query ignoring tax_query when is_singular
- How do I exclude the lowest level terms in a taxonomy?
- WordPress query with items from more than one selfdefined taxonomy as `term` argument
- Display most popular in the past two days
- How to display an other custom post type in a different custom post type’s archive?
- Search form not working with custom query?
- Post loop for all taxonomy terms
- New WP_Query calls Pre_get_posts filter twice
- how to access query string in wordpress?
- find posts that don’t have a custom taxonomy
- Merge two search functions for custom post type
- Filter Custom Taxonomy Posts
- WP_Query args to show posts from specific custom taxonomy
- Make a SQL query with wpdb in WordPress
- get all posts associated with a custom taxonomy
- How to set an alternate posts_per_page value for default queries in different templates
- Error with function in functions.php?
- Tax Query only returns for the first of several terms
- Can’t fetch Custom Post Type Data through Custom Query
- WP_Query to output chosen term and posts with no term assigned
- WP Job Manager plugin – Listing only the twelve job categories on frontpage order by jobs they have
- Exclude authors IDs from WP_Query
- Loading two different AJAX requests on two different pages
- Getting the post terms ‘wp_get_post_terms’ per post when within the functions.php file
- How to print term name inside wp post loop
- Multiple meta_key ordering with pre_get_posts
- Check if a post has term inside loop
- How do I fit WP_Query arguments into a function?
- How to get posts by category and by choosing a taxonomy term?
- How to restrict search on a certain page to only return results against custom taxonomies?
- Query Taxonomy By Page Title
- relation OR instead of AND – Filtered term ID’s in loop
- get_the_terms has strange result since version 6.0
- How to display posts from custom post type category(custom Taxonomy) wise?
- Why is my pagination /page/2 taking me to index.php?
- set object terms after some some time of published post – functions.php
- Filter for each loop when WP_Query has no posts to show
- wp_set_object_terms() custom taxonomy not working correctly when using insert post
- How do I stop the same post showing multiple times in a archive?
- Custom WordPress post query for displaying time-released content on website
- Related categories order posts by category
- SEARCH QUERY PLEASE HELP | call_user_func_array() expects parameter 1 to be a valid callback php
- WordPress – Form does not filter the results of taxonomies
- WP Query for all events prior to current date
- How to get taxonomy image attached to a Post Type WordPress
- list all post who have mutual taxonomy as current taxonomy!
- Finding post ID dynamically on click
- how to move a page from one drop down menu to another drop down menu
- Show one post of each custom taxonomy
- Displaying posts from sub taxonomies only
- Taxonomy archive, categorised by other taxonomy, not hiding empty taxonomies
- How to define a custom hierarchy for terms?
- My entry results are not consistently alphabetized
- Get post Number with local loop and template
- Adding additional taxonomies to wordpress taxonomy page
- I cannot get tax_query in get_posts() to work with custom taxonomy
- Calling a function with WP_Query only ever brings the first result
- Query Top Set Custom Taxonomy In Given Timeperiod
- Fetching $_POST from Page Template into functions.php
- Custom query for tag and custom tag from 2 post type
- How to add meta fields to custom taxonomy add/edit page?
- I wan to process the following js to process the AJAX Request on my function to calculate author Total Post views
- Get newest value of an array
- Filter custom post type by custom taxomony
- ordering and optimizing functions
- Why WP_Query in functions.php is not working when get_posts works?
- query_posts problem – need help
- Adding css tweak based on page template
- How to write a query-function as a query-shortcode?
- Give attachments an archive page, and exclude unattached ones
- Variations as Single Products [closed]
- Custom Taxonomy in custom REST API search
- I’m trying to get posts under a custom taxonomy but I don’t know what I’m doing wrong here
- taxonomy-{term}.php terms pagination returning 404 after a certain page
- Display Featured image from custom post type category (custom taxonomy) wise