How do I use an Advanced Custom Field as a Shortcode. Ive used the following code in the WordPress functions.php file but no luck.

Here is my Code:

function location_date_func( $atts ){
    return "<?php the_field('location_date', 658); ?>";
}
add_shortcode( 'location_date', 'location_date_func' );

Read more here: Return ACF field as a Shortcode using WordPress Functions.php file


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , , ,

Wordpress related questions and answers: