Tag Info

Hot answers tagged

1

The function you are using, get_most_recent_post_of_user, won't work as it only retrieves the latest post from the author. It cannot retieve a list of posts Walks through each of a user's blogs to find the post with the most recent post_date_gmt. You will most probably be better of using either WP_Query or get_posts to achieve this. You should first ...


1

As I already stated in a comment to your answer, you should never make use of query_posts Note: This function isn't meant to be used by plugins or themes. As explained later, there are better, more performant options to alter the main query. query_posts() is overly simplistic and problematic way to modify main query of a page by replacing it with new ...


1

Use 'offset' in your query to start two posts before the current one. So if you're iterating through posts and the current post is number 14, then offset by 12 and ask for 5 posts. This will give you numbers 12-16 which is what you need and nothing more. $args = array( 'category' => $mycat, 'numberposts' => 5, 'offset' => 12, ); $posts = ...



Only top voted, non community-wiki answers of a minimum length are eligible