Forums

post excerpt and more tag (4 posts)

  1. tjobbe
    Member
    Posted 3 years ago #

    Hi everyone, I am using a custom page template to show a page as my home page and I'm using a bit of code to show the latest post in a custom sidebar.

    How do I get this code to stop where I have defined it to do so with the <!--more--> tag?

    At the moment it shows the whole post, but I'd like it to stop after the more tag if possible.

    heres what I have now:

    <h3>Latest free recipe</h3>
    <?php $temp_query = $wp_query; ?>
    <?php query_posts('category_name=recipes&amp;showposts=1'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></p>
    <?php the_content('click for recipe', FALSE, ''); ?>
    <?php endwhile; ?>
  2. Chris_K
    Member
    Posted 3 years ago #

    I wonder if this bit would help? (from the_content documentation):

    http://codex.wordpress.org/Template_Tags/the_content#Overriding_Archive.2FSingle_Page_Behavior

  3. tjobbe
    Member
    Posted 3 years ago #

    Thank you Chris K, I wasn't being lazy - just sometimes don't know where to start looking!

  4. Chris_K
    Member
    Posted 3 years ago #

    Oh no doubt!

    And I don't know what I offered is the solution either. But it seemed worth a shot...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.