add_shortcode
add shortcode with [my_shortcode] syntax.
add_shortcode( "kodeku", "a" );
function a(){
return "mantap";
}
if have file html or php we can use like this.
<?php
ob_start();
?>
<div>
<span>text</span>
<a href="#">link</a>
</div>
<?php
$content = ob_get_clean();
// return the $content
?>
Last updated