WP_Query issues with argument posts_per_page

Try to add ‘post_type’ => ‘any’, ‘post_stauts’ => ‘any’, to your arguments and see what happens. This should retrieve posts in all post types with any post status. If it only retrieves 252 posts, then the other posts doesn’t not meet your criteria in your query. The other important thing is that with such an … Read more

Add rel to all images in a post

something like this can be useful: function image_tag($html, $id, $alt, $title) { return preg_replace(array( “https://wordpress.stackexchange.com/”.str_replace(‘//’,’//’,get_bloginfo(‘url’)).’/i’, ‘/s+width=”d+”/i’, ‘/s+height=”d+”/i’, ‘/alt=””/i’ ), array( ”, ”, ”, ‘alt=”‘ . $title . ‘”‘ ), $html); } add_filter(‘get_image_tag’, ‘image_tag’, 0, 4);

have_posts() return false on single post

Late answer but, one possible scenario this could be happening is if you register two custom post types with the same permalink slug. You can debug this by doing a var_dump of the global variable $wp_query. global $wp_query; var_dump($wp_query); Check to see if the post_type in the query matches the post type of the page … Read more