query_posts not working after wordpress 3.7 update

Get rid of query_posts() in your template file. Instead, you need to filter the main query object, via pre_get_posts. The following function will exclude the specified category and change posts per page for the main blog posts index: function wpse102566_pre_get_posts( $query ) { if ( is_home() && $query->is_main_query() ) { $query->set( ‘category__not_in’, array( ‘103’ ) … Read more

query_posts result differs from wp_query request result

You are improperly using query_posts. Don’t use query_posts, ever. If you want to iterate over an array of posts, use get_posts and assign the results to a var that isn’t a reserved global. $my_posts = get_posts( array( ‘posts_per_page’ => 5, ‘paged’ => 1, ‘post_status’ => ‘publish’ ‘orderby’ => ‘date’, ‘order’ => ‘desc’ ) ); foreach( … Read more

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

get_posts and wp_autop (remove filter)

You could make your own excerpt function: function wpse125086_custom_strip_tags_excerpt() { global $post; $p_obj = get_post($post->ID); $p_exp = $p_obj->post_excerpt; $p_exp = apply_filters(‘the_excerpt’, $p_exp); $un_p = array(“<p>”, “</p>”); $p_exp = str_replace($un_p, “”, $p_exp); echo $pcont; } But generally I’m thinking instead of transforming to get_posts() it might be better to go with WP_Query. In this case the … Read more

wp_query by last month + sort posts

The recent addition of date query makes it possible to use very elaborate conditions, see Date Parameters documentation in Codex. As for outputting certain set of posts the simplest way might be to create dedicated page with custom page template for it.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)