WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Simple Category Page Help (3 posts)

  1. iamharlan
    Member
    Posted 4 years ago #

    Hey folks...

    I'm putting together a custom wordpress theme for a client...and am very new at it. I've got everything starting to come together, but I want to be able to create a page that displays a list of posts from a certain category.

    I've got this working almost the way I want. Here's my code...

    <div class="newspage"><?php query_posts('category_name=News&showposts=5'); ?>
    <?php while (have_posts()) : the_post(); ?>
            <strong><a href="<?php the_permalink(); ?>">
              <?php the_title(); ?>
              </a>  </strong>
    <?php endwhile; ?>
    
    </div>

    And here's the link to it working...

    I'm having issues with two things. One...I have the content showing up without actually calling for it. This leads to my second issue...I want to show the excerpt after the title, and I want to be able to style it. It seems to be just one block of text now, and I can't style it individually.

    What am I doing wrong here?

  2. iamharlan
    Member
    Posted 4 years ago #

    EDIT: I think I have it figured out now how to style them individually....but I have a new problem.

    I have multiple posts in that category...but only have the title from one post showing up. The other post's content is showing up, but not the title.

    What's up?

    Here's my code:

    <div class="newspage"><?php query_posts('category_name=News&showposts=5'); ?>
    <?php the_post() ?>
    	<div id="post-<?php the_ID() ?>" <?php post_class() ?>>
    	  <div class="newsposttitle"><strong><a href="<?php the_permalink(); ?>">
              <?php the_title(); ?>
              </a>  </strong></div>
    	<div class="newsposttext typeface-js" style="font-family: Helvetiker">
    
    <?php the_excerpt() ?>
  3. iamharlan
    Member
    Posted 4 years ago #

    Anyone?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.