Shortcode outside posts and pages aka..

…what would I do without my users #2.

I have recently discovered myself that wordpress can call and “interpret” shortcodes also outside the usual posts and pages.

How do you do this? Use the PHP code below in any header or footer or non-widget ready sidebar or any PHP file of your theme and replace the text between brackets [] with your own shortcode, of course.

<?php echo do_shortcode(‘[shortcode-short attribute1="true" attribute2="10"]‘); ?>

Bear in mind, if the plugin is not installed, activated or it’s not him :-) then you will be echoed the text in brackets without any change.

Have fun with it!

No related posts.

TrackBack

TrackBack URL for this entry:
http://www.stefaniamarchisio.com/2010/03/shortcode-outside-posts-and-pages-aka/trackback/

Post a comment