Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save nextab/ff012bf15a2054414033b9fc5cb1e93e to your computer and use it in GitHub Desktop.

Select an option

Save nextab/ff012bf15a2054414033b9fc5cb1e93e to your computer and use it in GitHub Desktop.
function test($atts, $content = null) {
$a = shortcode_atts([
'class' => ''
], $atts);
$return_string = '';
$my_field = get_field('my_field');
$my_class = get_field('my_class');
$return_string .= '<div class="test ' . $a["class"] . '"><h4 class="my_headline">' . $my_field . '</h4>
<ul class="my-list"><li class="' . $my_class . '">Hier steht irgendwas</li></ul></div>';
return $return_string;
}
add_shortcode('test', 'test');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment