Timeline for Conditional for Custom Post Types
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 10, 2011 at 3:24 | comment | added | patnz | I've put code in the question above. I think this should work though not all your code is there because there's an include (get_template_part()). The loop on your get_posts() query is a bit odd too. I'm pretty sure wp-start() is deprecated & you shouldn't need the counter in your loop since you have numberposts in your query... but if it's working... | |
Nov 10, 2011 at 3:20 | history | edited | patnz | CC BY-SA 3.0 |
Added formatted code to answer
|
Nov 10, 2011 at 0:35 | comment | added | Erika | <?php query_posts( array( 'posts_per_page' => 10, 'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1 ), )); ?> <?php $posts = get_posts( array ( 'numberposts' => '10', 'post_type' => array ( 'post', 'episodes', 'featured-stories' ), )); foreach ($posts as $post) : start_wp(); ?> <?php static $count2 = 0; if ($count2 == "10") { break; } else { ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php $count2++; } ?> <?php endforeach; ?> | |
Nov 10, 2011 at 0:33 | comment | added | Erika | Not sure how to incoporate that with the loops I have on my page: | |
Nov 9, 2011 at 18:05 | history | answered | patnz | CC BY-SA 3.0 |