wordpress loop first two post

Solutions on MaxInterview for wordpress loop first two post by the best coders in the world

showing results for - "wordpress loop first two post"
Lennart
04 Aug 2020
1<div class="col-lg-12">
2    <div class="row">
3
4            <?php if ( have_posts() ) : ?>
5            <?php if ( in_category( 'Featured' ) ) : /* Start the Featured Loop */ ?>
6
7                <?php while( have_posts() ) : the_post(); ?>
8
9                <?php if( $wp_query->current_post == 0 ) { 
10                //open wide column wrapper div// ?>
11                <?php } ?>
12
13                <?php if( $wp_query->current_post <= 1 ) { 
14                get_template_part( 'content', 'featured' );
15                //insert large post// ?>
16                <?php } ?>
17
18                <?php if( $wp_query->current_post == 1 || $wp_query->current_post <= 1 && $wp_query->current_post == $wp_query->post_count-1 ) { 
19                //close wide column div// ?>
20                <?php } ?>
21
22                <?php if( $wp_query->current_post == 2 || $wp_query->current_post <= 1 && $wp_query->current_post == $wp_query->post_count-1 ) { 
23                //open narrow column wrapper div// ?>
24                <?php } ?>
25
26                <?php if( $wp_query->current_post >= 2 ) { 
27                get_template_part( 'content', 'featuredside' );
28                //insert small post//?>
29                <?php } ?>
30
31                <?php if( $wp_query->current_post == 4 || $wp_query->current_post == $wp_query->post_count-1 ) { 
32                //close narrow column div// ?>
33                <?php } ?>
34
35                <?php endwhile; ?>
36
37                    <?php endif; ?>
38
39                <?php endif; ?>
40
41    </div> <!--/.row-->
42</div> <!--/.col-lg-12-->
queries leading to this page
3c 3fphp while 28have posts 28 29 29 3a the post 28 29 3b the content 28 29 3f 3e 3c 3fphp endwhile 3b 3f 3ewordpress loop have 2 first postswordpress the loopwordpress loopwordpress loop functionspost loop wordpresswordpress post loop last threewordpress for loopwp while loopthe loop wpwordpress for eachwordpress the posthow to show multiple page loops in htmlwordpress loowordpress while have postwhile in wordpress themethe loop wordpreloop post wordpresstheloop wordpressif hwile loo 5bp wordpressget post in loop wordpressphp wordpress loopwordpress loop first two postthe loop wp handbook 24loop 3ethe post 28 29wordpress close the loopwp run loopcustom have posts wordpressloop wordpresswordpress modify post loop templateblog loop wordpress 24loop 3ehave posts 28 29wp while loop the contentloop wodpress postwordpress default loopwordpress content loop codex 3c 3fphpif 28have posts 28 29 29 3awhile 28have posts 28 29 29 3athe post 28 29 3bwordpress loop phppost loop 5btestimonial average rating 5d loop html div wordpressposts loop wordpresswhile 28 24loop 3ehave posts 28 29 29 3a 24loop 3ethe post 28 29 3bthe post 28 29 3bhave post condition in wordpresswordpress post loopwordpress loop the postwordpress loopscustom wordpress loopwhile have posts 28 29 the post 28 29 idsthe loop wordpresswhile loop wocommerwordpress can i have to while loops in a post 3fwordpress loop contentif have post wordpress loopin a standard template file how often does the wordpress loop runword press while schleifewp loophow often does wordpress loop runif 28have posts 28 29 29 3a while 28have posts 28 29 29 3a the post 28 29 3b query posts 28 29the wordpress loophave post wordpressthe loop php wordpresshow to creat loop in wordpresswhile loop wordpressloop post wordpress readthe loop wp 3 last postwordpress loop first two post