get_posts now altering main loop
-
I recently updated WordPress to 4.1.1 and get_posts is altering the main loop now.
See: http://prayerforastrugglingartist.com/2014/11/30/levi-jun-miscala/
I even moved my get_posts query out of the main template, but it’s definitely altering the main loop.
Code for the posts index on the left:
<li><a href="<?php echo get_category_link(1); ?>">Testimonials</a> <ul> <?php $posts = get_posts( 'category=1&orderby=title' ); foreach( $posts as $p ) { ?> <li><a href="<?php echo get_permalink( $p->ID ); ?>"><?php echo $p->post_title; ?></a></li> <?php } ?> </ul> </li>Is there any alternative I can use, since it looks like it’s broken for now?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘get_posts now altering main loop’ is closed to new replies.