Creating a Shortcode

Creating a Shortcode

The PHP snippet below provides an example to use [my_shortcode] to output text string of 「short code example」:

add_shortcode( 'my_shortcode', function() {
ob_start();
// Start your PHP below

echo 'short code example';

// End your PHP above
return ob_get_clean();
} );

發表回覆

您的郵箱地址不會被公開。 必填項已用 * 標註