WordPress.org

Ready to get started?Download WordPress

Forums

<!--more--> tag ignored (3 posts)

  1. Leon
    Member
    Posted 7 years ago #

    Hey there,

    On my site http://www.virbskins.co.uk, I have a page which displays every first post of four different categories. I did this with the get_post script I found here.

    <?php $lastposts = get_posts('numberposts=1&category=3');
            foreach($lastposts as $post) :
            setup_postdata($post);
          ?>
    	  <h2 class="first_column_head1"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    	  <div class="post_content">
    	    <?php the_content(__('Read more...')); ?>
    	  </div>
          <?php endforeach; ?>

    Now I read on this page, that the <!--more--> tag doesn't work if there's only one post. Is there some way I can hack this?

    Thanks!

  2. Samuel B
    moderator
    Posted 7 years ago #

    I think you just need to change the_content to the_excerpt.

  3. Leon
    Member
    Posted 7 years ago #

    Hmm.. Yes I tried that, but it doesn't work, probably because I have only an image before the <!--more-->tag. And the exerpt doesn't work with html tags I think...

Topic Closed

This topic has been closed to new replies.

About this Topic