Using functions.php for outputting ACF
-
Hi,
I know that this code will work if e edit the child theme or us a code plugin.
add_action( 'woocommerce_single_product_summary', 'product_subtitle', 5 ); function product_subtitle() { ?> <?php if(get_field('my_subtitle')) { ?> <div class="style_my_subtitle"><?php the_field('my_subtitle'); ?></div> <?php } }However I would like to use the functions.php instead and wrap the ACF output into a div for styling. If I use the code above in the functions.php i get a critical error. Can you please point me into the correct direction which code I have to use to use a div in the functions.php
Kind regards,
Mike
The topic ‘Using functions.php for outputting ACF’ is closed to new replies.