Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Use shortcode in a PHP file (outside the post editor).
- echo do_shortcode( '' );
- 1
- 2
- // In case there is opening and closing shortcode.
- echo do_shortcode( '[iscorrect]' . $text_to_be_wrapped_in_shortcode . '[/iscorrect]' );
- 1
- 2
- // Enable the use of shortcodes in text widgets.
- add_filter( 'widget_text', 'do_shortcode' );
- 1
- 2
- // Use shortcodes in form like Landing Page Template.
- echo do_shortcode( '[contact-form-7 id="91" title="quote"]' );
- 1
- 2
- 3
- // Store the short code in a variable.
- $var = do_shortcode( '' );
- echo $var;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement