ESI shortcode doesn’t work
-
I created a shortcode like this.
<?php function shortcode_today() { return date_i18n("Y/n/j(D) G:i s"); } add_shortcode('today_date', 'shortcode_today');
When pasted into the post, [today_date] works fine and displays the current time.
but,
[esi today_date]
[esi today_date ttl=”0″]
[esi today_date cache=”private” ttl=”0″]
[esi today_date ttl=”1″]
None of them work.@qtwrk answered on the forum,
function test_shortcode($atts) { $atts = shortcode_atts( array( 'show_date' => 'false', ), $atts, 'test_sc' ); if ($atts['show_date'] === 'true') { $current_date = date('Y-m-d H:i:s'); $message .= ' generation time: ' . $current_date . '.'; } return $message; } add_shortcode('test_sc', 'test_shortcode');
and
<?php require( './wp-load.php' ); echo do_shortcode('[esi test_sc show_date="true" ttl="0"]');
worked. ESI itself seems to work.
How should I debug it?
I’m using Fastcomet server litespeed enterprise.
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘ESI shortcode doesn’t work’ is closed to new replies.