Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jsudesign

    (@jsudesign)

    bump

    Thread Starter jsudesign

    (@jsudesign)

    Ok, so I’ve fixed this and Im posting this incase someone else comes across this and wants to do the same. Note: There might be a better way to do this, but this is what worked for me, feel free to post the better way if you know how.

    These are the 4 steps I took in doing this.

    1. Install the Content and Excerpt Word Limit Plug-in
    2. Create a new template file.
    3. Follow Step 3
    4. Follow Step 4
    5. Your Done

    Step 3.
    Add this chunk of code to the top of your page.

    <?php
    // Include WordPress
    query_posts('showposts=2');
    ?>

    Note: It’s showing 2 posts, change the 2 to something like 5 and you will get 5 posts.

    Then Add this code to where you wish to display the recent posts.

    <?php while (have_posts()): the_post(); ?>
    <p><a href="<?php the_permalink(); ?>"><?php excerpt('13'); ?></a></p><span class="news_date"><?php the_time('d.M.Y') ?></span>
    <?php endwhile; ?>

    Step 4.
    Your almost done, but the last part is to remove the read more link that is placed in there by our new plug-in. I know this isn’t a very clean way of doing things, but it works non-less. Add this code to your new page’s styles.

    p.readmore { display: none; }

    Step 5.
    Your done! Now, like I said… there’s probally an easier cleaner way of doing things through php, but since I’m a wordpress newbie & had to figure things out for myself this is what I came up with.

    Feel free to post your own solutions as well.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘How to show recent posts body.’ is closed to new replies.