Home › Forums › General Issues › Displaying acf values in Elementor using HTML › Reply To: Displaying acf values in Elementor using HTML
That’s actually a really good approach — using an ACF text field for the marquee makes it much easier for non-technical users to update the scrolling text without touching any code.
You can try this clean setup:
<div class=”loop”>
<div class=”content”>
<?php
$marquee_text = get_field(‘marquee_txt’);
if( $marquee_text ) {
echo esc_html($marquee_text);
} else {
echo ‘See calendar for details ✦’;
}
?>
</div>
</div>
This way, if someone adds text to the marquee_txt field, it’ll automatically appear inside your scrolling div. If they leave it blank, it’ll show your default message (“See calendar for details ✦”).
You can drop this directly into your Elementor HTML widget (make sure the page uses the correct ACF field group).
This keeps things simple and plugin-free — perfect for a non-profit setup!
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.