How to display category's name next to the title of post ?
-
I want to display the category name next to the title of posts in this section :
<?php $fPosts = new WP_Query( array( 'offset' => 1, 'posts_per_page' => 10, 'category_name' => 'class 9', 'post__in' => get_option("sticky_posts"), 'ignore_sticky_posts' => 1, )); ?> <h1>New Lessons </h1> <div id="boxscroll"> <?php if ( $fPosts->have_posts() ) : ?> <ul> <?php /* Start the Loop */ ?> <?php while ( $fPosts->have_posts() ) : $fPosts->the_post(); ?> <li class="featured-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'noteworthy' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php if(the_title( '', '', false ) !='') the_title(); else _e( 'View Post', 'noteworthy' ); ?></a></li> <?php endwhile; ?> <?php endif; ?> </ul> <?php wp_reset_query(); ?> </div>
Thanks !
- The topic ‘How to display category's name next to the title of post ?’ is closed to new replies.