How to Get the Category Title/Name


Using the below code get the category name

 <?php echo get_cat_name(category ID here) ?>

Example:

<?php query_posts("cat=3");?>
<?php echo get_cat_name(3);?>
<?php while(have_posts()): the_post();?>
<?php the_content();?>
<?php endwhile;?>
Advertisements

Query post page navigation in wordpress


Problem : Page navigation problem with custom query ?

Solution :  Find below

wp_Pagenavi    in query posts:

  1.         Download the Pagenavi plugin from the wordpress
  2.         Install plugin & active plugin
  3.         finally  use the below code     
<?php query_posts('showposts=6'.'&paged='.get_query_var('paged') ;?>
<?php while ( have_posts() ) : the_post(); ?>
<?php the_content();?>
<?php endwhile; // end of the loop. ?>
<?php wp_pagenavi() //call pagenavi?>