I'm using the Flexible Content add-on for Advanced Custom Fields and having trouble formatting a simple button link in my template code.
Normally I'd use something like this...
<a class="button" href="<?php the_field('button-link'); ?>"><?php the_field('button-text'); ?></a>
...to output the following html:
<a class="button" href="http://url.com/the-link">The Text</a>
But I can't figure out how to adapt that to work within my flexible content template:
<?php
if( have_rows('sidebar-content') ):
while ( have_rows('sidebar-content') ) : the_row();
if( get_row_layout() == 'text-content' ):
echo '<div class="sidebar-text-content">';
the_sub_field('flexible-text-content');
echo '</div>';
elseif( get_row_layout() == 'quote' ):
echo '<blockquote>';
the_sub_field('quote-text');
echo '<span class="quote-source">';
the_sub_field('quote-source');
echo '</span>';
echo '</blockquote>';
elseif( get_row_layout() == 'images' ):
$image = get_sub_field('image');
echo '<img src="' . $image['sizes']['large'] . '" alt="' . $image['alt'] . '" />';
endif;
endwhile;
endif;
?>
Any suggestions? Thanks in advance