WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. jamo_dodger
    Member
    Posted 1 year ago #

    Hello,

    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.

    http://www.makewpwebsites.com/

    Thanks very much

    James

  2. Samantha Marie
    Member
    Posted 11 months ago #

    I would edit the php. Like this:

    <?php query_posts('cat=#&posts_per_page=#'); ?>
    <?php while (have_posts()) : the_post(); ?>
    	<li>
    	<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'); ?>
            </a>
    	</li>
    <?php endwhile; ?>
    <?php wp_reset_query(); ?>

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

  3. jamo_dodger
    Member
    Posted 11 months ago #

    Thanks for your help Samantha Marie,

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

    Thanks

    JAmes

  4. Samantha Marie
    Member
    Posted 11 months 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
    Member
    Posted 11 months ago #

    sorry samantha the password is [redacted]

    [NEVER post passwords in a public forum!]

  6. jamo_dodger
    Member
    Posted 11 months ago #

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

  7. esmi
    Theme Diva & Forum Moderator
    Posted 11 months ago #

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

  8. Samantha Marie
    Member
    Posted 10 months ago #

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

  9. ravijethva88
    Member
    Posted 6 months ago #

    hello
    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