WordPress.org

Ready to get started?Download WordPress

Forums

Problem with "More" (1 post)

  1. thomas514
    Member
    Posted 2 years ago #

    I want to display the last 2 posts of cat 4, that works great like this:

    <?php
    // The Query
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('cat=4&posts_per_page=2&paged=' . $paged);
    // The Loop
    while (have_posts()) : the_post(); ?>
    <?php the_title(); ?>
    <?php the_content('LIRE LA SUITE »'); ?>
    <?php endwhile;
    // Reset Query
    wp_reset_query();
    ?>

    but it does not work anymore when I add another code before to display a specific post:

    <?php
    query_posts( 'p=38' );
    // set $more to 0 in order to only get the first part of the post
    global $more;
    $more = 0;
    // the Loop
    while (have_posts()) : the_post(); ?>
    <?php the_content( 'LIRE LA SUITE »' );
    endwhile;
    ?>

    What happens is that the post displays completely, the "more" is not taken into account....

    Anyone who can help me here correct this?
    Anyone can tell me here what to do to make it work?

Topic Closed

This topic has been closed to new replies.

About this Topic