WordPress Posts Out Of Order after 3.1 Update

Simply add orderby to your query_posts <?php query_posts($query_string . ‘&cat=-4&orderby=date&order=DESC’); ?> Update try: global $wp_query; $args = array_merge( $wp_query->query, array(‘cat’ => -4,’orderby’ => ‘date’,’order’ => ‘ASC’)); query_posts( $args ); and if you still get the same change ASC to DESC.

Show the title of the latest post by author

You can get the latest post of an author adding the following code to your function: $latest_post = get_posts( array( ‘author’ => $id, ‘orderby’ => ‘date’, ‘numberposts’ => 1 )); // Since get_posts() returns an array, but we know we only // need one element, let’s just get the element we need. $latest_post = $latest_post[0]; … Read more

Count singular post views automatically

You could hook into template_redirect and execute a helper function: add_action( ‘template_redirect’, ‘wpse_75558_count’ ); function wpse_75558_count() { if ( is_singular() ) setPostViews( get_the_ID() ); } To display the post views, you have to use a later hook. I would recommend the_content: add_filter( ‘the_content’, ‘wpse_75558_show_count’ ); function wpse_75558_show_count( $content ) { $count = getPostViews( get_the_ID() ); … Read more

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