Support

Account

Home Forums General Issues Displaying acf values in Elementor using HTML Reply To: Displaying acf values in Elementor using HTML

  • Thanks for your reply kisanportal

    Unfotunately I still get just the name of the shortcode displaying. Here is my code edited as you suggest:

    // Add Shortcode to use acf field value in scrolling marquee
    function marquee_text_shortcode( $atts , $content = null ) {
    $post_id = get_the_ID();
    $marquee_text = get_field(‘marquee_txt’,$postID);

    // Check if the field has content and return it
    if ( $marquee_text ) {
    // We use esc_html() to make sure the output is secure
    return esc_html($marquee_text);
    }

    }
    add_shortcode( ‘scroll_txt’, ‘marquee_text_shortcode’ );

    }