[ad_1]
[ad_2]
Hi, I have been trying to figure out how to have words dynamically change in a text.
For example
If you want to have information on (Dynamic word) follow this link.
I tried using ACF to create a but it only works for the whole text and not just a word within the text. I tried using {{Dynamic_word}} within the text doesn't work.
I'm using elementor/WordPress to build the website.
If anyone as any idea on how solve it I would be thankful.
use a shortcode. you can just insert it in any elementor text and it will return whatever you like.
Example: Show the current date
— insert this code into theme or child themes function.php
// Shortcode to display the current date function display_current_date() {
return date_i18n(get_option(‘date_format’));
}
add_shortcode(‘current_date’, ‘display_current_date’);
—
Usage:
Today is [current_date].
//if this is not enough you need to provide us with more information. where will the dynamic words come from? are they set per page? random? any other logic? otherwise it is pretty hard to help.