WordPress.org

Ready to get started?Download WordPress

Forums

Custom Category Navigation (2 posts)

  1. Sparkydude03
    Member
    Posted 6 years ago #

    I was wondering if you could help me out with a quick line of code. I am trying to create a ESPN.com styled news slider that has different tabs. In each tab it's supposed to pull posts from a specific category and display 5 of each. Is this the correct way to do it?

    <?php query_posts('cat=35');
    			if(have_posts()) : ?>
    			<?php while(have_posts()) { the_post(); ?>
    				<?php if($post_count >= 5)
    					{break;}?>
    				<div class="post"><a onmouseover="Tip('<?php echo nl2br($post->post_excerpt); ?>')" href="<?php if ($source != '') { echo $source; } else { the_permalink(); } ?>"><?php the_title(); ?></a> <small><?php the_date(); ?></small>
            		</div>
    				<?php endwhile; ?>
    				<?php } ?>
  2. Sparkydude03
    Member
    Posted 6 years ago #

    Hello?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags