• Resolved salmancrusher

    (@salmancrusher)


    Hello, I have a simple shortcode

    function cp_get_most_read(){
    $cp_most_read = get_option(‘cp_most_read_items_html’);
    return $cp_most_read;
    }

    add_shortcode(‘cp_get_most_read’,’cp_get_most_read’);

    When I use
    [esi cp_get_most_read ttl=”7200″]

    No output, the shortcode is printed “as-is”

    [cp_get_most_read]

    works fine

    This is an Elementor page.

    Can you help me with this?

    I tried directly creating a php ESI block

    add_action( ‘litespeed_esi_load-display_most_read’, ‘most_read_block_content’ );

    function most_read_block_content()
    {
    $cp_most_read = get_option(‘cp_most_read_items_html’);

    do_action( 'litespeed_control_force_public', 'a custom note to shown in debug log' );
    do_action( 'litespeed_control_set_ttl', '300' );
      return $cp_most_read;    

    }
    add_shortcode(‘most_read_block_content’,’most_read_block_content’);

    but I dont think this works, because I am just returning the content, and not apply echo or rendering the content direclt on the template.

    Can you advise?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support qtwrk

    (@qtwrk)

    No output, the shortcode is printed “as-is”

    this typically happens when ESI is not enabled, please verify

    and are you using OpenLiteSpeed ? or LiteSpeed Enterprise or something else ?

    Thread Starter salmancrusher

    (@salmancrusher)

    i use litespeed WP plugin running on litespeed enterprise.

    esi is enabled for sure, if you see my second block of code which uses ESI filter, then it renders correctly.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘ESI Shortcode doesnt work with Elementor’ is closed to new replies.