Created
October 30, 2017 14:11
-
-
Save BiancaNL/545e09c7b8fa6deebcaf32173f962863 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function acf_pricing_table() { | |
ob_start(); | |
?> | |
<?php if( have_rows('pricing_table') ): ?> | |
<div class="pricing-table-container"> | |
<?php while( have_rows('pricing_table') ): the_row(); | |
$price = get_sub_field('price'); | |
$description = get_sub_field('description'); | |
$features = get_sub_field('features'); | |
$btntxt = get_sub_field('button_text'); | |
$btnlink = get_sub_field('button_link'); | |
?> | |
<div class="acf-pricing-table"> | |
<div class="acf-pricing-table-price"> <?php echo $price ?> </div> | |
<div class="acf-pricing-table-price-desc"> <?php echo $description ?> </div> | |
<?php if( have_rows('features') ): ?> | |
<div class="acf-pricing-table-features"> | |
<ul> | |
<?php while( have_rows('features') ): the_row(); | |
$feature = get_sub_field('feature'); | |
?> | |
<li class="acf-pricing-table-feature"> <?php echo $feature ?> </li> | |
<?php endwhile; ?> | |
</ul> | |
</div> | |
<?php endif; ?> | |
<a class="acf-pricing-table-button" href=" <?php echo $btnlink ?>" title="<?php echo $description ?> <?php echo $btntxt ?>"> <?php echo $btntxt ?></a> | |
</div> | |
<?php endwhile; ?> | |
</div> | |
<?php endif; ?> | |
<?php | |
return ob_get_clean(); | |
} | |
add_shortcode( 'acf-pricing-table',' acf_pricing_table' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment