php - ACF repeater field showing outside of <li></li> -


i have created custom widget i'm calling acf items in it. have echoed out custom fields , working fine reason repeater field items showing outside of <li> when @ source code? idea went wrong in code?

    if( get_field('background') ):     echo "<p class='contact-title'>background/experience</p>";         echo "<ul>";             while( have_rows('background') ): the_row();             echo "<li>". the_sub_field('licences__permits__etc'). "</li>";             endwhile;         echo "</ul>";     endif; 

it outputs this

<p class="contact-title">background/experience</p>     <ul>     babysitter     <li></li>     driver's permit     <li></li>     og loc     <li></li> </ul> 

the_field() functions echo-es content. if want concatenate <li> returned value, must use get_sub_field() - returns value. so

echo "<li>". get_sub_field('licences__permits__etc'). "</li>"; 

or

echo "<li>"; the_sub_field('licences__permits__etc'); echo "</li>" 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -