WordPress.org

Ready to get started?Download WordPress

Forums

Index-like page on a Page (2 posts)

  1. kahi
    Member
    Posted 7 years ago #

    I'm trying to display on a Page a list of posts - such way, that's to see on the default index page. But... I don't understand why WordPress does it elseway than I need :).

    The code:

    $mq = new WP_Query('showposts=5');
    if ($mq->have_posts()) : while ($mq->have_posts()) : $mq->the_post();
    ?><h2><?php the_title(); ?></h2><?php
    the_content('more');
    endwhile; endif ?>

    1) Content is displayed whole - not only to the "more" sign & without the "more link". Why?
    2) Second - I'd like to know how to build the query so that the previous/next links after the loop are displayed correctly (now, they are not visible - I guess it has something with the query...).

    Thank you for your help.

  2. kahi
    Member
    Posted 7 years ago #

    well, still I don't know the answer but problem has been solved by different way... I stayed on index.php and if is_paged, then I display posts e.g. like in archive...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags