Home / functions.php / WordPress shortcodes
  • How to WordPress shortcodes

    no thumbnail sorry: WordPress shortcodes

    This is the most simple of wordpress shortcodes. Placing [mysite] within your post will be replaced by the hyperlink within the mysite function. Place this code within the functions.php of your wordpress theme.

    ( click code to copy )

    wordpress snippet : PHP

    <>
    function mysite(){
    	return '<a href="http://mysite.com">visit my website</a>';
    }
    add_shortcode('mysite', 'mysite');
    

    ( WordPress codex functions, hooks, in this snippet. )

    add_shortcode,