how to call the category of the post

Well first off, that code’s a mess to read, some formatting would definitely help get you an answer. That said, here’s the documentation on WP_Query and some sample code to boot $args = array( ‘post_status’ => ‘publish’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘category’, ‘field’ => ‘slug’, ‘terms’ => ‘your_cat_slug’ ) ) ); $posts = … Read more

get_posts() method and paging is not working

@user702325 Here’s how i got it working fine on localhost: I installed the plugin and set the option Place Pager Automatically in Template on “on“. Then in author.php i modified the original query to add some custom parameters. I added this: global $query_string; // required $posts = query_posts(‘posts_per_page=2’); right between rewind_posts(); and get_template_part( ‘loop’, ‘author’ … Read more

get_posts displaying wrong permalink for “continue reading” link

You need to reset the post data after your get_posts loop since your calling setup_postdata. It would be better to remove the setup_postdata all together. global $post; $recent_posts = get_posts( $yourargshere ); foreach($recent_posts as $post) : $return = ‘<h4 class=”recent-post-title c0″>’ . $post->post_title . ‘</h4>’; $return .= ‘<p class=”recent-content c0″>’ . apply_filters( ‘the_excerpt’, $post->post_excerpt ) … Read more

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