Home › Forums › General Issues › Displaying acf values in Elementor using HTML › Reply To: Displaying acf values in Elementor using HTML
Thanks for your help nisasafdar
Unfotunately that solution does not work and I think it might be because Elementor does not all PHP to run in an HTML widget.
As an alternative I tried to create a shortcode in the functions.php file but I am not having success with that either. Here is my code:
// Add Shortcode to use acf field value in scrolling marquee
function marquee_text_shortcode( $atts , $content = null ) {
$marquee_text = get_field(‘marquee_txt’);
return ‘‘ . $marquee_text . ‘‘;
}
add_shortcode( ‘scroll_txt’, ‘marquee_text_shortcode’ );
I have tried using [scroll_txt] in he shortcode widget and in a text box widget but only the name of the shortcode is displayed.
Any other suggestions?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.