Get post closest to today
The parameter should be orderby rather than order_by. (See codex)
The parameter should be orderby rather than order_by. (See codex)
I cannot search users via user nicename
How to exclude posts ordered by comment_count from subsequent wordpress loops using WP_Query?
From next_posts_link: Add the $max_pages parameter to the next_posts_link() function when querying the loop with WP_Query. To get the total amount of pages you can use the ‘max_num_pages’ property of the custom WP_Query object. next_posts_link( ‘Next →’, $connected->max_num_pages );
Why WP_Query in functions.php is not working when get_posts works?
You can simplify things by using the date_query of WP_Query(), instead of the posts_where filter. You can then try the following (untested): // Fetch from the ‘featured’ category $args = array( ‘posts_per_page’ => 1, ‘category_name’ => ‘featured’, ‘date_query’ => array( array( ‘after’ => ‘1 week ago’ ) ), ); $the_query = new WP_Query( $args ); … Read more
I don’t think your code does what you think, as it is only ever set to a single post from one of your loops. You description doesn’t really match that logic. To prevent duplicates you need to accumulate an array of IDs with each Loop. $do_not_duplicate[] = $post->ID; I think the space you are seeing … Read more
You have a structural problem with your data. Serialized data in the database is terrible if you need to search over pieces of that serialized data. There is no reliable, efficient, and certainly no easy, SQL query to search over serialized data. “serialization” is a PHP mechanism. It isn’t SQL. To the database that is … Read more
Stop link being removed in menu/list when viewing that post
query_posts with sorting on a custom datestamp