Blogroll – Different layout for first post

Creating 2 queries for your scope is absolutely an not need work… Use only one query and use the $wp_query->current_post property to change the output of first post.. $args = array ( ‘pagination’ => true, ‘paged’ => $paged, ‘posts_per_page’ => ’10’, ‘ignore_sticky_posts’ => true, ‘order’ => ‘DESC’, ‘orderby’ => ‘date’, ); // The Query $query … Read more

Programmatically set ‘meta_query’ for filter

A meta_query has to be an array of arrays. You only have an array. A filter needs to return information. Yours doesn’t. Of course, parse_query is an action not a filter, despite your use of add_filter. Use add_action instead. I would use pre_get_posts instead of parse_query. It is the next hook that fires after parse_query … Read more

How can I retrieve comments from last 5 minutes for a post?

Note that the function wp_list_comments() doesn’t fetch the comments, only displays them in various ways depending on the input arguments. You’re actually using the WP_Comment_Query/get_comments input arguments into wp_list_comments(). You could try this instead: $postID = 12345; // Adjust this! $comments = get_comments( [ ‘date_query’ => [ ‘after’ => ‘5 minutes ago’, ‘inclusive’ => true, … Read more

Wp query orderby ‘title’ doesn’t work

Try adding ‘suppress_filters’ => true to your query args. Maybe you have a plugin that modifies the queries. You could also check if the posts out of order (the first one) is a sticky post. Sticky posts by default skip the order queue. You can disable this by adding ‘ignore_sticky_posts’ => true to your query … Read more