• <?php
    // retrieve one post with an ID of 5
    query_posts('p=5');
    
    global $more;
    // set $more to 0 in order to only get the first part of the post
    $more = 0; 
    
    // the Loop
    while (have_posts()) : the_post();
      // the content of the post
      the_content('Read the full post ?');
    endwhile;
    ?>

    The read more functionality with this query doesn’t work as i use the code.Is it a bug?

Viewing 4 replies - 1 through 4 (of 4 total)
  • I think that it is a bug, if you don’t use query_posts(), then you get the more link but when you do, it returns the full post content. Please try the code below:

    <?php
    $my_post_id = 17;
    $my_post = get_post( &amp;$my_post_id );
    if( $my_post ) {
    	setup_postdata( $my_post );
    	the_content('Read the full post ?');
    }
    ?>
    Thread Starter CGrrr

    (@cgrrr)

    Wow~Great code!Thank u very much!

    No problem!

    hey, i’m having the same problem

    Where exactly do you put this code? in the functions file? or the start of the loop

    and is it much different if my new query is calling all posts in a certain category instead of just one?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘The read more functionality with this query doesn’t work’ is closed to new replies.