Have Recent Posts Plugin Display Featured Image and Excerpt (9 posts)

  1. jamo_dodger
    Posted 3 years ago #


    I am new to WordPress and am trying to display my recent posts with title, date, featured image and excerpt on my homepage and was wondering what the best way to do this was. I am currently using the widgets on pages plugin to get a widget on my homepage content area atm. Should i:
    A) Just edit the php files
    B) use the recent posts widget and configure the php files a bit too
    C) Use a plugin such as advanced recent posts widget plugin ( i want to avoid this as to minimise the use of plugins.

    Any help would be greatly appreciated I have been stuck for ages.


    Thanks very much


  2. Samantha Marie
    Posted 3 years ago #

    I would edit the php. Like this:

    <?php query_posts('cat=#&posts_per_page=#'); ?>
    <?php while (have_posts()) : the_post(); ?>
    	<h4><a href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a></h4>
    	<?php the_date(); ?>
            <?php the_excerpt(); ?>
    	<a href="<?php echo get_permalink(); ?>">
                     <?php the_post_thumbnail('large_wide'); ?>
    <?php endwhile; ?>
    <?php wp_reset_query(); ?>

    Arrange and style accordingly and that should pull out everything you said you needed!

  3. jamo_dodger
    Posted 3 years ago #

    Thanks for your help Samantha Marie,

    Which php file do i edit and where abouts does this block of code go?



  4. Samantha Marie
    Posted 3 years ago #

    Hi James,
    You can insert that on whichever page you want to place it. Your home page is either home.php or index.php depending on your theme.

    Also, your site has a password on it so I can't look at it.

  5. jamo_dodger
    Posted 3 years ago #

    sorry samantha the password is [redacted]

    [NEVER post passwords in a public forum!]

  6. jamo_dodger
    Posted 3 years ago #

    i am using twenty eleven and i dont think there is a home.php,

  7. esmi
    Forum Moderator
    Posted 3 years ago #

    Do not edit the Twenty Eleven theme. First create a child theme for your changes.

  8. Samantha Marie
    Posted 3 years ago #

    Yeah that. Sorry I'm used to working with my own custom themes. Child themes is the right way to go!

  9. ravijethva88
    Posted 2 years ago #

    i created one plugins for sub post.how can i display that post in other page..?

Topic Closed

This topic has been closed to new replies.

About this Topic