How to End If/Else statement Advanced Custom Feilds
-
Hey Guy!
I am haveing problems ending the if else statement. I keeps on repenteing part of the code.
<a href="<?php the_field('widget_3_link'); ?>" class="widget-btn"><?php the_field('widget_3_text'); ?></a>
Can anyone help?
Thanks
<?php /** * Template Name: Landing Page 1 * The template for displaying all pages. * * @package Landing Page Creator */ get_header(custom); ?> <?php $bg = get_field('jt_bg_img'); $bigidea = get_field('big_idea'); $btnlink = get_field('cta_button_link'); $btntext = get_field('cta_button_text'); if($bg && $bigidea && $btnlink && $btntext): ?> <header style="background: url(<?=$bg?>) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; padding: 8em 0; text-align: center" class="jumbotron-alt"> <div class="row"> <div class="large-12 columns"> <h1 class="text-center"><?=$bigidea?></h1> <a href="<?=$btnlink?>" class="jumbotron-btn"><?=$btntext?></a> </div><!--.large-12 .columns --> </div><!--.row --> </header> <section class="services"> <div class="row" data-equalizer> <div class="small-3 medium-3 large-3 columns text-center" data-equalizer-watch> <?php the_field('widget_1'); ?> <a href="<?php the_field('widget_1_link'); ?>" class="widget-btn"><?php the_field('widget_1_text'); ?></a> </div> <div class="small-3 medium-3 large-3 columns text-center" data-equalizer-watch> <?php the_field('widget_2'); ?> <a href="<?php the_field('widget_2_link'); ?>" class="widget-btn"><?php the_field('widget_2_text'); ?></a> </div> <div class="small-3 medium-3 large-3 columns text-center" data-equalizer-watch> <?php the_field('widget_3'); ?> <a href="<?php the_field('widget_3_link'); ?>" class="widget-btn"><?php the_field('widget_3_text'); ?></a> </div> <div class="small-3 medium-3 large-3 columns text-center" data-equalizer-watch> <?php the_field('widget_4'); ?> <a href="<?php the_field('widget_4_link'); ?>" class="widget-btn"><?php the_field('widget_4_text'); ?></a2 </div> </div><!-- .row --> </section> <?php else : ?> <header class="jumbotron text-center"> <div class="row"> <div class="large-12 columns"> <h1>The Big Idea Statement</h1> <a href="#" class="button tiny">Default Button</a> </div><!--.large-12 .columns --> </div><!--.row --> </header> <?php endif ; ?> <?php get_footer(); ?>
- The topic ‘How to End If/Else statement Advanced Custom Feilds’ is closed to new replies.