WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How can I exclude an image from the main page? (3 posts)

  1. csowsley
    Member
    Posted 3 years ago #

    I'm stuck. Using a modified theme from Empire, I have a column on the front page which calls the latest blog posts that works fine but not exactly how I'd like it to work. It includes the image in the post.
    Does anyone know how to call only the text above the <!--more--> tag and exclude images added in the post?
    Right now all I can do is insert the image below the more tag as a work around. I'd rather just exclude images from the front page all together. Here is the div from the main page:
    <div class="latest-blog">

    <h3>From the Blog</h3>

    <?php query_posts("showposts=1");
    query_posts('category_name=General'); global $more; $more=0;?>

    <?php while (have_posts()) : the_post(); global $more; $more=0;?>

    <h4>" rel="bookmark" title="Go to <?php the_title_attribute(); ?>"><?php the_title(); ?></h4>
    <div class="latest-entry">
    <?php the_content('Read more...', $more_link_text, $strip_teaser, $more_file ); ?>
    </div>

    <p class="meta">Written on <?php the_date(); ?></p>
    <?php endwhile; ?>

    </div><!--/latest-blog-->

    Is there anything I can do?
    Any bit of help is greatly appreciated.

  2. Josh Leuze
    Member
    Posted 3 years ago #

    If you want just a bit of text from the posts, you could try using the_excerpt template tag instead of the_content.

  3. csowsley
    Member
    Posted 3 years ago #

    Thanks. I tried that but it doesn't keep the 'share' links. I came up with a work-around that satisfies the problem for the time being- I put the inserted image below the 'more' tag. Not exactly what I wanted, but it does the job.

Topic Closed

This topic has been closed to new replies.

About this Topic