Created
April 2, 2020 20:27
-
-
Save prosantamazumder/d701503b8ed946fbfa7ea265818ee7d6 to your computer and use it in GitHub Desktop.
create wp short code WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHORTCODE.PHP | |
------------------------ | |
function functionname(){ | |
ob_start(); | |
?> | |
HTMLCODEHERE.. | |
<?php | |
return ob_get_clean(); | |
} | |
add_shortcode('shortcodename', 'functionname'); | |
--------------------------- | |
show any page | |
--------------------------- | |
<?php echo do_shortcode('[shortcodename]'); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment