display only parent replies count in index.php

Based on this answer I suggest the following code: // the theme’s functions.php /** * Get the number of top level comments for a post. * * @param int $post_id * @return int */ function wpse_95242_top_level_comments_for_post( $post_id = NULL ) { if ( NULL === $post_id ) $post_id = get_the_ID(); if ( ! $post_id ) … Read more

Pagination not working with custom loop

I’ve run into this problem with PageNavi before. My solution is to hijack the $wp_query variable temporarily and then reassign it after closing the loop. An exmaple: <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $args=array( ‘post_type’=>’post’, ‘cat’ => 6, ‘posts_per_page’ => 5, ‘paged’=>$paged ); $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query($args); /* … Read more

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