Modify Taxonomy pages to exclude items in child taxonomies
I found this question:
I found this question:
Theres a way to use $query->set('tax_query', ...) in pre_get_posts filter? for example next code is not altering the query. Note that I’m building $taxonomies from and custom search.
How can I change arguments for the main query only, and not affect other queries?
I have a multisite network of sites which should display blog content from each other if the blog post has a tag with the site name.
The default search returns all post types, which is what I want. But for one specific custom post type I want to limit the result to a specific meta key value (a custom date that must be greater than today).
How can I change the order of posts in the admin dashboard, so they display alphabetically according to title, rather than latest first?
this question is strongly related to this question where I already got a working answer.
I have a WordPress loop, that is part of an AJAX call. Every time a button is clicked, this function is called, runs the below loop and outputs the next 6 posts. There are already five posts shown by default. How can I exclude the five latest (most recent published) posts from the WordPress loop? So that page 1 of the loop starts with the 6th, 7th, 8th, 9th, 10th & 11th post?
I have a filter using pre_get_posts to change the number of posts per page from 4 on the news landing page to 8 on all other pages (page 2, 3, etc). However I don’t seem to have got the offset correct, or something, because my get_next_posts_page_link doesn’t show a page 3, even though it does exist if I go to the url manually. The current offset is something I somehow managed to conjure up accidentally, I thought it worked as page 2 was correct but as I added more test posts, I realised it didn’t work.
I’ve been modifying the built in WP search using the pre_get_posts filter, allowing the user to sort the posts (including a bunch of custom post types) by different fields.