Sample of a single post on static homepage (5 posts)

  1. particlepat
    Posted 7 years ago #

    Hi I'm trying to create a simple snippet of my most recent post on my homepage in a designated container. I want the title to be displayed using <h1> and then in smaller italics I want it to show the date it was posted and the authors real name, not id. Then I want the post to show a small excerpt of the actual post with a link at the bottom that says Read the rest of this post and of course at the bottom, the number of comments and a link to Share Your Thoughts.

    Can somebody please help me out with the code and possibly break it down for me so that I can learn how it was done?

  2. particlepat
    Posted 7 years ago #

    i'm having trouble with this still, can anyone help?

  3. particlepat
    Posted 7 years ago #

    This is where I've gotten, I need to show only the most recent post on this particular page. http://www.bcsprosoft.com/blog

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    <div class="topPost">
    <h1 class="topTitle">"><?php the_title(); ?></h1>
    <p class="topMeta">by <?php the_author_firstname(); ?> <?php the_author_lastname(); ?> on <?php the_time('M. d, Y') ?>, under <?php the_category(', '); ?></p>

    <div class="entry">
    <?php the_excerpt(); ?>

  4. particlepat
    Posted 7 years ago #


  5. @mercime
    Volunteer Moderator
    Posted 7 years ago #

    Right after the_excerpt, you can add these (note - i added the span just in case you wanted to style the link - otherwise, delete the opening and closing spans

    <span class="read_on"><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Continue Reading</a></span>
    <span class="comment"><?php comments_popup_link('Post a comment', 'One comment', '% comments', '', 'Comments off'); ?></span>

Topic Closed

This topic has been closed to new replies.

About this Topic