Executing a shortcode at the top of PAGE template?

The do_shortcode function accepts a string, searches the string for shortcodes, and processes any that are found. That means that… // Use shortcode in a PHP file (outside the post editor). echo do_shortcode(”); … is all you need to run a shortcode (code taken from the Codex). Your request that the shortcode be inserted “somewhere … Read more

How to reuse php templates as shortcodes?

You can write a wrap function for short code like that. function simplest_shortcode_ever() { ob_start(); ?> Your PHP Logic here <?php return ob_get_clean(); } add_shortcode( ‘simple_shortcode’, ‘simplest_shortcode_ever’ ); And then use it[simple_shortcode]

Shortcode to do math with url variables

In your case, because you call [URLParam] twice, you need to store this data in session, because every call of your shortcode is isolated. If number of params is fixed (param1, param2 and operation, for example) better use it in single shortcode. Actually, there is a lot of variations, how to solve this. You can … Read more

Primary menu shortcode name

You basically have everything set. You simply need to call the shortcode: [shortcodemenu menu=”slug-of-your-menu”] Remember to use the SLUG of the menu you want to show instead of its name.