Home Forums Backend Issues (wp-admin) ACF Field as WP Shortcode


ACF Field as WP Shortcode

  • Trying to use an ACF field as a Shortcode in the WordPress Functions.php file. I originally tried using the default ACF Shortcode but could not get it to work so decided to try this way. But still no luck.

    // Add Shortcode
    function location_date_func( $atts ){
    	return "<?php the_field('location_date', 658); ?>";
    add_shortcode( 'location_date', 'location_date_func' );
Viewing 1 post (of 1 total)

The topic ‘ACF Field as WP Shortcode’ is closed to new replies.