wordpress loop first two post

<div class="col-lg-12">
    <div class="row">

            <?php if ( have_posts() ) : ?>
            <?php if ( in_category( 'Featured' ) ) : /* Start the Featured Loop */ ?>

                <?php while( have_posts() ) : the_post(); ?>

                <?php if( $wp_query->current_post == 0 ) { 
                //open wide column wrapper div// ?>
                <?php } ?>

                <?php if( $wp_query->current_post <= 1 ) { 
                get_template_part( 'content', 'featured' );
                //insert large post// ?>
                <?php } ?>

                <?php if( $wp_query->current_post == 1 || $wp_query->current_post <= 1 && $wp_query->current_post == $wp_query->post_count-1 ) { 
                //close wide column div// ?>
                <?php } ?>

                <?php if( $wp_query->current_post == 2 || $wp_query->current_post <= 1 && $wp_query->current_post == $wp_query->post_count-1 ) { 
                //open narrow column wrapper div// ?>
                <?php } ?>

                <?php if( $wp_query->current_post >= 2 ) { 
                get_template_part( 'content', 'featuredside' );
                //insert small post//?>
                <?php } ?>

                <?php if( $wp_query->current_post == 4 || $wp_query->current_post == $wp_query->post_count-1 ) { 
                //close narrow column div// ?>
                <?php } ?>

                <?php endwhile; ?>

                    <?php endif; ?>

                <?php endif; ?>

    </div> <!--/.row-->
</div> <!--/.col-lg-12-->

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
wordpress loop have 2 first posts word Press while schleife the loop wp 3 last post the loop wp the loop wordpre &lt;?php while (have_posts()) : the_post(); the_content()?&gt; &lt;?php endwhile;?&gt; if (have_posts()) : while (have_posts()) : the_post(); query_posts() how to creat loop in wordpress the loop wp handbook wordpress for each theloop wordpress wordpress post loop last three wordpress loop the_post the wordpress loop the loop php wordpress wordpress the_post wordpress while have post while ( $loop-&gt;have_posts() ) : $loop-&gt;the_post(); custom have_posts wordpress while have_posts() the_post() ids while loop wordpress have post wordpress the_post(); wordpress loops wp loop custom wordpress loop &lt;?phpif(have_posts()):while(have_posts()):the_post(); blog loop wordpress if hwile loo[p wordpress post loop wordpress Post loop $loop-&gt;have_posts() while loop wocommer $loop-&gt;the_post() loop wordpress php wordpress loop how often does wordpress loop run loop post wordpress loop post wordpress read wordpress loop php how to show multiple page loops in html wordpress close the loop have post condition in wordpress get post in loop wordpress loop wodpress post wordpress for loop wp while loop the content wp while loop wordpress loo posts loop wordpress wordpress default loop the loop wordpress if have post wordpress loop while in wordpress theme [testimonial_average_rating] loop html div wordpress wordpress post loop wordpress the loop wordpress loop content Wordpress can I have to while loops in a post? wordpress loop in a standard template file how often does the wordpress loop run wordpress modify post loop template wordpress content loop codex wp run loop wordpress loop functions
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source