WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Query_posts - "Read the rest of this entry" doesn't show (5 posts)

  1. guzh
    Member
    Posted 5 years ago #

    Hi,

    as the topic says. When I call query_posts, the text-link "Read the rest of this entry" doesn't appear. So whole posts are showing..

    Here is my code:

    <?php query_posts('cat=5'); ?>
    
      <?php while (have_posts()) : the_post(); ?>
    
        <div class="post" id="post-<?php the_ID(); ?>">
          <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
         <div class="postmetadata">Posted
         <!-- the date and time -->
         on <?php the_time(get_option('date_format')) ?>, <?php the_time(get_option('time_format')) ?>,
         <!-- post author -->
         by <?php the_author() ?>,
         <!-- post category -->
         under <?php the_category(', ') ?>.
         </div>
    
         <div class="entry">
            <?php the_content('Read the rest of this entry &raquo;'); ?>
         </div>
    
         <div class="postmetadata">
           <?php if( function_exists('the_tags') )
            the_tags(__('Tags: '), ', ', '');
           ?>
           <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></div>
          </div>
      <?php endwhile; ?>
  2. DFdou
    Member
    Posted 5 years ago #

    is there <!--more--> in your content?
    en,in there is no <!--more-->,wordpress will show whole posts

  3. guzh
    Member
    Posted 5 years ago #

    I've added the <!--more--> -tag..

    The Index-page shows the post correctly. but not this page.
    The only difference between the index.php and this is that I call have_posts (in index) instead of query_posts..

  4. MichaelH
    Member
    Posted 5 years ago #

    If the quicktag <!--more--> is used in a post to designate the "cut-off" point for the post to be excerpted, the_content() tag will only show the excerpt up to the <!--more--> quicktag point on non-single/non-permalink post pages

    See if this helps in before loop:

    global $more;
    $more = 0;

    Resources:
    the_content()
    Customizing_the_Read_More

    [edited]

  5. guzh
    Member
    Posted 5 years ago #

    ah!

    It worked with:

    <?php query_posts('cat=5&orderby=date');
    	   global $more;
    	   $more = 0;
    	?>

    thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic