• 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 !

Viewing 2 replies - 31 through 32 (of 32 total)
  • Thread Starter Morocco English

    (@rifhawk)

    have opened my site link???

    Thread Starter Morocco English

    (@rifhawk)

    yes I wanted the category name to be in same line next to the title …
    now the cat name drops down the title …

    this is the code I have in the css

    li.featured-title {
    border-bottom: 1px solid #e1e1e1;
    
    			}
    li.featured-title:last-child {
    border-bottom: 0;
    }
    
    li.featured-title a {
    display: block;
    background: url(library/images/bullet.png) no-repeat right center;
    padding: 9px 15px 9px 0;
    text-decoration: none;
    font: bold 13px Arial, Helvetica, sans-serif;
    color: #000;
    line-height:5px;
    }
    li.featured-title a:hover {
    						color: #9a181c;
    }
    
    li.featured-title:last-child a {
    						padding-bottom: 0;
    					}
Viewing 2 replies - 31 through 32 (of 32 total)
  • The topic ‘How to display category's name next to the title of post ?’ is closed to new replies.