Home › Forums › Add-ons › Flexible Content Field › Order inside a concatenated string › Reply To: Order inside a concatenated string
Thank you, John. I knew it was something simple.. I don’t know how I missed it. Also, I isolated the heading number using the PHP explode function:
<?php
// check if the flexible content field has rows of data
if( have_rows('page_layout') ):
// loop through the rows of data
while ( have_rows('page_layout') ) : the_row();
if( get_row_layout() == 'heading_text' ):
$headingLevel = get_sub_field('heading_level');
$headingLevelIsolated = (explode(" ",$headingLevel));
$headingContent = get_sub_field('heading_content');
echo '<h' . $headingLevelIsolated[1] . '>' . $headingContent . '</h' . $headingLevelIsolated[1] . '>';
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.