WP_Query on single or static page, if multiple loops e.g. in footer
-
I want to use multiple loops on a Page (page.php) and a single post (single.php) – the main loop for content, other loops in the footer
<?php $loop1 = new WP_Query();?> <?php if ($loop1->have_posts()) : while ($loop1->have_posts()) : $loop1->the_post(); ?> DO STUFF <?php endif; ?> <?php wp_reset_query();?>
I’m thinking of something like this for the main loop, but I’ve tested it and it doesn’t work.
Nor does
<?php $loop1 = new WP_Query(array('orderby' => DESC));?>
Clearly I’m going in the wrong direction.
Anyone have any ideas?
Thanks.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘WP_Query on single or static page, if multiple loops e.g. in footer’ is closed to new replies.