• Resolved goldmember

    (@goldmember)


    on this page of my site (https://www.diveneycue.com/wordpress/) i have the code below included to display recent post titles and their excerpts.

    however, i’d like to do two things:

    1. edit the amount of lines included in the excerpt

    2. include only the very thumbnail that’s in each posting (each posting will typically contain three or four thumbnails at the very top of the postings)

    please advise how i do this. thanks!

    <h2>New Diveney Cues</h2>
    <?php $recent = new WP_Query("cat=29&showposts=3"); while($recent->have_posts()) : $recent->the_post();?>
    <a href="<?php the_permalink() ?>">
    <?php the_title(); ?></a>
     <?php the_excerpt(); ?>
    <?php endwhile; ?>

Viewing 6 replies - 1 through 6 (of 6 total)
  • Use the following two plugins:
    Get the Image and Advanced Excerpt.

    Thread Starter goldmember

    (@goldmember)

    the “Get the Image” plugin seems to be what i’m looking for, but without using the Advanced Excerpt plugin, shouldn’t the excerpt normally default to display everything i have in the posting up to the point where i put this <!--more-->?????

    here’s my code for the front page where i want to show the excerpts at the bottom:

    <h2>New Diveney Cues</h2>
    <?php $recent = new WP_Query("cat=29&showposts=3"); while($recent->have_posts()) : $recent->the_post();?>
    <a href="<?php the_permalink() ?>">
    <?php the_title(); ?></a>
    <?php get_the_image(); ?>
    <?php the_excerpt(); ?>
    <?php endwhile; ?>
    <br />

    and here’s where i have the MORE tag in my posting:

    Lizard wrap
    G10 Radial Pin
    <!--more-->
    <strong>Price</strong>
    $TBD

    Yes, you could definitely do that, it just depends on if you want to manually cut it off every time as opposed to using the plugin to automatically cut it off after a certain length that you specify.

    Thread Starter goldmember

    (@goldmember)

    well the thing is i tried that but it doesnt seem to be working. i used the “more” code, as depicted above. so in theory, the price should not show on the homepage where the excerpt is. but it does! ??????

    I think that it’s because you have the <?php the_excerpt(); ?>, which is a separate thing from the ‘read more’ tag. The ‘read more’ tag works with the_content();. I am not stating that as fact, though. Someone may know better.

    Thread Starter goldmember

    (@goldmember)

    i switched it to the_content, instead of the_excerpt, but that change did not work.

    anybody else know? should i start a new thread?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Including first thumbnail in excerpt’ is closed to new replies.