WordPress.org

Ready to get started?Download WordPress

Forums

Post Style (3 posts)

  1. Ferghal
    Member
    Posted 8 years ago #

    Im having some problem with my posts appearing on a site, I have bloded the title of the style, but it only does this for the first one and doesnt repeat for the older ones..

    View: http://www.ennisurbanboardgaa.ie

    Code:

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <?php the_title(); ?><BR></span>Posted on
    <?php the_date(''); ?>
    by:
    <?php the_author() ?>
    <?php the_content(__('(more...)')); ?>
    <br>
    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
    <?php comments_template(); // Get wp-comments.php template ?>
    <h2 align="left" class="style1 style2"> <br>
    <?php wp_link_pages(); ?>
    </h2>
    <h2 align="left" class="style1 style2">
    <?php endwhile; else: ?>
    </h2>
    <p align="left"> <span class="style1">
    <?php _e('Sorry, no posts matched your criteria.'); ?>
    </span>
    <p class="style1">
    <?php endif; ?>

    Any ideas anyone??

  2. add1sun
    Member
    Posted 8 years ago #

    Your span element doesn't begin within the loop. So the other posts after the first don't get the begin span signal. You need to have :

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <span><?php the_title(); ?></span><br />

    I would also put the break after the end span and I'm using the XHTML compliant version of the break tag in this example.

  3. resiny
    Member
    Posted 8 years ago #

    erm...spam? ^^^

    edit- fixed now

Topic Closed

This topic has been closed to new replies.

About this Topic