Jon Garza
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Plugins
In reply to: [Minimalistic Event Manager] Loop the next 5 events?Everything is super clear!!!
Thank you so much for your quick response, It works perfectly
Forum: Themes and Templates
In reply to: multiples loops in interlayered categories without duplicatesThis is probably not the right way to do it, but using ‘offset’ => 1 fix the problem for now.
<article class="post" id="postmedium"> <?php query_posts( array( 'category_name' => 'category1', 'posts_per_page' => 1, 'post__not_in' => $do_not_duplicate, 'offset' => 1 ) ); while ( have_posts() ) : the_post();?> <!--Do Stuff--> <?php endwhile; ?>If somebody knows a better way, please let me know
Forum: Themes and Templates
In reply to: multiples loops in interlayered categories without duplicatesHere’s my code, what am I doing wrong???
<?php $do_not_duplicate = array(); query_posts('category_name=category1&posts_per_page=1'); while ( have_posts() ) : the_post(); $do_not_duplicate = $post->ID; ?> <!--Do Stuff--> <?php endwhile; ?> <?php $do_not_duplicate = array(); query_posts('category_name=category2&posts_per_page=1'); while ( have_posts() ) : the_post(); $do_not_duplicate[] = $post->ID; ?> <!--Do Stuff--> <?php endwhile; ?> <article class="post" id="postmedium"> <?php query_posts( array( 'category_name' => 'category1', 'posts_per_page' => 1, 'post__not_in' => $do_not_duplicate ) ); while ( have_posts() ) : the_post();?> <!--Do Stuff--> <?php endwhile; ?> <?php query_posts( array( 'category_name' => 'category2', 'posts_per_page' => 1, 'post__not_in' => $do_not_duplicate ) ); while ( have_posts() ) : the_post();?> <!--Do Stuff--> <?php endwhile; ?>The “category2” post doesn’t repeat, the problem is with “category2”
Viewing 3 replies - 1 through 3 (of 3 total)