I am trying to add a an acf field called "name" while also adding a css-class to it
the_field('name')
to this code
if ($go_magazine_options['post_meta_author'] === 'enable' && in_the_loop()) {
echo '<span class="client">' . get_the_field('name') .
'<span class="entry-meta-author author vcard"><i class="fa fa-user"></i><a class="fn" href="' .
esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' .
esc_html(get_the_author()) . '</a></span>' . "\n";
}
but something is not working?
I am trying to add a an acf field called "name" while also adding a css-class to it
the_field('name')
to this code
if ($go_magazine_options['post_meta_author'] === 'enable' && in_the_loop()) {
echo '<span class="client">' . get_the_field('name') .
'<span class="entry-meta-author author vcard"><i class="fa fa-user"></i><a class="fn" href="' .
esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' .
esc_html(get_the_author()) . '</a></span>' . "\n";
}
but something is not working?
Share Improve this question edited Mar 4, 2021 at 17:32 fuxia♦ 107k38 gold badges255 silver badges459 bronze badges asked Mar 4, 2021 at 15:16 Aprilia ParrinoAprilia Parrino 431 gold badge2 silver badges9 bronze badges1 Answer
Reset to default 0Little Aprilia learns to code ;-) was a silly idea to mix two things, justed added the ACF-Field, using its own if-rule
if( get_field('apri') ): ?>
<span class= "promo"><?php the_field('apri'); ?></span>
<?php endif;