Created
May 7, 2020 18:19
-
-
Save david-strejc/3127baf42e981805182d72d768aae3b0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
add_shortcode( 'field_name', function () { | |
$values = get_field('field_name'); | |
if($values) | |
{ | |
echo '<ul>'; | |
foreach($values as $value) | |
{ | |
echo '<li>' . $value . '</li>'; | |
} | |
echo '</ul>'; | |
} | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Replace field_name with your desired variable and use [field_name] in WP.