sample

<?php
get_header(); ?>
 
 
 
<?php 
    // Check value exists.
    if( have_rows(‘home_page’) ):
 
        // Loop through rows.
        while ( have_rows(‘home_page’) ): the_row(); ?>
        
        
        
        <!– Hero Section Start –>
        
             <?php 
                 if( get_row_layout() == ‘banner_section’ ):
                       
                       $animationTitle = get_sub_field(‘animation_title’);
                       $bannerbgImage = get_sub_field(‘bg_image’);
                       $smallTitle = get_sub_field(‘small_title’);
                       $bigTitle = get_sub_field(‘big_title’); 
                       $bannerDis = get_sub_field(‘banner_desc’);
                       $bannerbtn = get_sub_field(‘banner_button’);
                       $bannerSeconButton = get_sub_field(‘banner_secon_button’);?>
                       
                       
                <section class=”hero-section fix hero-1 hero-2 bg-cover” style=”background-image: url(‘<?php echo esc_url($bannerbgImage[‘url’]); ?>’);”>
                    <div class=”text-transparent”>
                        <h2><?php echo $animationTitle; ?></h2>
                    </div>
                    <div class=”line-shape”>
                        <img src=”<?php echo get_template_directory_uri();?>/new/assets/img/hero/line-shape.png” alt=”shape-img”>
                    </div>
                    <!– <div class=”dot-shape”>
                        <img src=”<?php echo get_template_directory_uri();?>/new/assets/img/hero/dot-shape.png” alt=”shape-img”>
                    </div> –>
                    <!– <div class=”frame-shape”>
                        <img src=”<?php echo get_template_directory_uri();?>/new/assets/img/hero/frame.png” alt=”shape-img”>
                    </div> –>
                    <div class=”container”>
                        <div class=”row g-4 align-items-center”>
                            <div class=”col-lg-8″>
                                <div class=”hero-content”>
                                    <h6 class=”wow fadeInUp”><?php echo $smallTitle; ?></h6>
                                    <h1 class=”wow fadeInUp”>
                                       <?php echo $bigTitle; ?>
                                    </h1>
<?php echo $bannerDis; ?>
                                    <div class=”hero-button”>
                                        <a href=”<?php echo esc_url($bannerbtn[‘url’]); ?>” class=”theme-btn”>
                                            About Us
                                            <i class=”fa-solid fa-arrow-right-long”></i>
                                        </a>
                                        <a href=”<?php echo esc_url($bannerSeconButton[‘url’]); ?>” class=”theme-btn”>
                                            Explore more
                                            <i class=”fa-solid fa-arrow-right-long”></i>
                                        </a>
                                    </div>
                                </div>
                            </div>
                            <div class=”col-lg-4″>
                                <div class=”hero-image wow fadeInUp”>
                                    <!–<img src=”<php echo esc_url($bannerSeconButton[‘url’]); ?>” alt=”hero-img”>–>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>
        
        <?php endif; ?> 
        
        <?php 
                 if( get_row_layout() == ‘service_section’ ):
               
                       $ServiceBgImage = get_sub_field(‘service_bg_image’);
                       $ServiceSmallTitle = get_sub_field(‘service_small_title’);
                       $ServiceBigTitle = get_sub_field(‘service_big_title’); 
                       $ServiceDescription = get_sub_field(‘service_description’);
                       $ServiceButton = get_sub_field(‘service_button’);?>
        
                 <!– Service Section Start –>
            <section class=”service-section fix section-padding” id=”section-padding1″
                style=”background-image: url(‘<?php echo esc_url($ServiceBgImage[‘url’]); ?>’);”>
                <div class=”overlay”></div>
                <div class=”container”>
                        <div class=”section-title”>
                            <span class=”wow fadeInUp”>
                                <?php echo $ServiceSmallTitle; ?>
                                </span>
                            <h2 class=”wow fadeInUp” data-wow-delay=”.3s”>
                                <?php echo $ServiceBigTitle; ?>
                            </h2>
                        </div>
                    <div class=”service-wrapper mb-0″>
                        <div class=”row”>
                                
                                <?php 
                                    while( have_rows(‘service_box’) ) : the_row();
                                        $iconImage = get_sub_field(‘icon_image’);
                                        $boxTitle = get_sub_field(‘box_title’);
                                        $boxContent = get_sub_field(‘box_content’);
                                        $boxButton = get_sub_field(‘box_button’);
                                        ?>
                                
                                    <div class=”col-xl-3 col-lg-4 col-md-6 wow fadeInUp p-3″ data-wow-delay=”.3s”>
                                        <div class=”service-box-items box-shadow”>
                                            <div class=”icon”>
                                                <img src=”<?php echo esc_url($iconImage[‘url’]); ?>” alt=”icon-img”>
                                            </div>
                                            <div class=”content”>
                                                <h4>
                                                    <a href=”<?php echo esc_url($boxButton[‘url’]); ?>”>
                                                        <?php echo $boxTitle; ?>
                                                    </a>
                                                </h4>
                                                <p>
                                                    <?php echo $boxContent; ?>
                                                </p>
                                                <a href=”<?php echo esc_url($boxButton[‘url’]); ?>” class=”theme-btn-2 mt-3″>
                                                    read More
                                                    <i class=”fa-solid fa-arrow-right-long”></i>
                                                </a>
                                            </div>
                                        </div>
                                    </div>
                                    
                                <?php endwhile; ?>
                                
                                <div class=”service-text wow fadeInUp” data-wow-delay=”.4s”>
                                    <h6>
                                        <?php echo $ServiceDescription; ?> <a href=”<?php echo esc_url($ServiceButton[‘url’]); ?>” class=”theme-btn”>View All of Our Services </a>
                                    </h6>
                                </div>
                                
                        </div>
                        
                        
                    
                    </div>
                </div>
            </section>
        <?php endif; ?> 
        
         
         
            <?php 
             if( get_row_layout() == ‘blog_section’ ):
                $SmallTitle = get_sub_field(‘small_title’);
                $BigTitle = get_sub_field(‘big_title’);
                $blogSectionButton = get_sub_field(‘blog_section_button’);?>
                
                <!– News Section Start –>
                <section class=”news-section-4 fix section-padding bg-cover”
                    style=”background-image: url(‘<?php echo get_template_directory_uri();?>/assets/images/bg-img.jpg’);”>
                    <div class=”container px-4 px-lg-0″>
                        <div class=”section-title text-center”>
                            <span class=”wow fadeInUp”><?php echo $SmallTitle;?></span>
                            <h2 class=”wow fadeInUp” data-wow-delay=”.3s”>
                                <?php echo $BigTitle;?>
                            </h2>
                        </div>
                        
                        <?php if ( get_sub_field(‘show_custom_blog’) == true ) { ?>
            <?php
            
            // Check rows existexists.
            if( have_rows(‘blog_box’) ): ?>
           
                        <div class=”row”>
                            
                             <?php 
                              while( have_rows(‘blog_box’) ) : the_row();
                                $blogImage= get_sub_field(‘blog_image’);
                                $blogTitle = get_sub_field(‘blog_title’);
                                $blogButton = get_sub_field(‘blog_button’);?>
                            
                                    <div class=”col-xl-4 col-lg-6 col-md-6 wow fadeInUp” data-wow-delay=”.3s”>
                                        <div class=”news-card-items style-2 style-3″>
                                            <div class=”news-image”>
                                                <img src=”<?php echo esc_url($blogImage[‘url’]); ?>” alt=”news-img”>
                                                <div class=”post-date”>
                                                    <h3>
                                                        19 <br>
                                                        <span>Feb</span>
                                                    </h3>
                                                </div>
                                            </div>
                                            <div class=”news-content”>
                                                <ul>
                                                    <li>
                                                        <i class=”fa-regular fa-user”></i>
                                                        By Admin
                                                    </li>
                                                    <li>
                                                        <i class=”fa-solid fa-tag”></i>
                                                        IT Services
                                                    </li>
                                                </ul>
                                                <h3>
                                                    <a href=”<?php echo esc_url($blogButton[‘url’]); ?>”>
                                                        <?php echo $blogTitle;?>
                                                    </a>
                                                </h3>
                                                <a href=”<?php echo esc_url($blogButton[‘url’]); ?>” class=”theme-btn-2 mt-3″>
                                                    read More
                                                    <i class=”fa-solid fa-arrow-right-long”></i>
                                                </a>
                                            </div>
                                        </div>
                                    </div>
                            
                             <?php endwhile; ?>
                            
                        </div>
                        <?php endif; ?>
            <?php } else { ?>
 
            <?php
            $args = array(
            ‘post_type’ => ‘post’,
            ‘post_status’ => ‘publish’,
            ‘posts_per_page’ => 3,
            );
            $values = new WP_Query($args);
            if($values->have_posts()) : ?>
           
            <div class=”row”>
            <?php
            while($values->have_posts()):
            $values->the_post();
           
            /*
            * Include the Post-Type-specific template for the content.
            * If you want to override this in a child theme, then include a file
            * called content-___.php (where ___ is the Post Type name) and that will be used instead.
            */
            get_template_part( ‘template-parts/content’, get_post_type() );
           
            endwhile; wp_reset_postdata(); ?>
            </div>
           
            <?php endif; ?> 
 
            <?php } ?> 
                    </div>
                    <div class=”hero-button” id=”blog-button”>
                        <a href=”<?php echo esc_url($blogSectionButton[‘url’]); ?>” class=”theme-btn wow fadeInUp” data-wow-delay=”.8s”
                            style=”visibility: visible; animation-delay: 0.8s; animation-name: fadeInUp;”>
                            All Blogs
                            <i class=”fa-solid fa-arrow-right-long”></i>
                        </a>
                    </div>
                </section>
         
         <?php endif; ?> 
         
    
        
          <?php endwhile; ?>  
<?php endif; ?> 
 
<?php the_content(); ?>
 
<?php 
 get_footer();
?>