As you know, WordPress function do_shortcode() will render whatever shortcode contains and is frequently used in custom templates. But if you want to allow site owners to update shortcodes easily, without messing with template files (and possibly causing PHP errors and white screens of death), you will want to consider using Advanced Custom Fields. All you need to do this to create custom field of text Field Type and then paste your shortcode inside. It could look like this:
In order to render the shortcode, you could do something like this (this goes into template files):
1 2 3 4 |
<?php $revslider_shortcode = get_field( 'revolution_slider_shortcode' ); echo do_shortcode($revslider_shortcode); ?> |
So the idea is to get the field value using get_field(), store it into variable and then render it using do_shortcode(). Also note the use of echo.