How to limit the number of results for all query_posts on mysite

It is not that hard to enforce a hard limit on results: add_action( ‘post_limits’, function($limit) { $limits = explode(‘,’,$limit); if (isset($limits[1]) && 2000 < $limits[‘1’]) { $limits[1] = 2000; } $limit = implode(‘,’,$limits); return $limit; } ); I would not be surprised if that does not solve your problem though. Just searching over that many … Read more

Show latest custom post types on dashboard

This is because by default the paramater for post_type is post. To include all the post type add the below to you arguements $args = array( ‘numberposts’ => 5, ‘post_type’ => ‘any’ ); The above will include all the post_types including pages and custom post types and if you would to include specific post types … Read more

Function to list posts from current post’s category fails in WP 3.8

I never found out what stopped the function from working with WP 3.8, but I found that this variant of it does work – and I have no idea why: <?php function list_posts_from_current_category() { if(is_single()){ $tempArray = get_the_category($post->ID); $FirstCatName = $tempArray[0]->slug; $this_post = get_the_ID(); $PostsPerPage = 5; query_posts(array(‘category_name’ => $FirstCatName, ‘post__not_in’ => array($this_post), ‘posts_per_page’ => … Read more