How to Display Post related Category Names


How to Display  Post related Category Names

<?php if ( is_object_in_taxonomy( get_post_type(), 'category' ) ) : // Hide category text when not supported ?>
            <?php
                /* translators: used between list items, there is a space after the comma */
                $categories_list = get_the_category_list( __( ', ', 'theme' ) );
                if ( $categories_list ):
            ?>
            <h4>
                <?php printf( __( '%2$s', 'theme' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list);
                  ?>
            </h4>
<?php endif; // End if categories ?>
 <?php endif; // End if is_object_in_taxonomy( get_post_type(), 'category' ) ?>

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?>