The loop will not loop
-
Hi!
What I want is pretty easy. I have a page which shall simply display the loop (all entries). I spent hours reading the documentation. There it says that
<?php if (have_posts()) : while (have_posts()) : the_post();?>
should do the job. It did not. From other places I basically learned I have to kind of initiate it. So I added the following above:<?php $args=array( 'posts_per_page' => 2 ); $wp_query = null; $wp_query = new WP_Query($args); ?>This now works as expected. Well, not quite. I also have the link for previous entries displayed. This appends /page/2/ to the URL of my page. But it does not do what it should do. I assume it has to do with what I entered above.
So what’s wrong? Where is the simple documentation for: “How to display the loop in a page?”
Thanks
pi
The topic ‘The loop will not loop’ is closed to new replies.