Advertisement
Guest User

Untitled

a guest
Oct 13th, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. // Use shortcode in a PHP file (outside the post editor).
  2. echo do_shortcode( '' );
  3. 1
  4. 2
  5. // In case there is opening and closing shortcode.
  6. echo do_shortcode( '[iscorrect]' . $text_to_be_wrapped_in_shortcode . '[/iscorrect]' );
  7. 1
  8. 2
  9. // Enable the use of shortcodes in text widgets.
  10. add_filter( 'widget_text', 'do_shortcode' );
  11. 1
  12. 2
  13. // Use shortcodes in form like Landing Page Template.
  14. echo do_shortcode( '[contact-form-7 id="91" title="quote"]' );
  15. 1
  16. 2
  17. 3
  18. // Store the short code in a variable.
  19. $var = do_shortcode( '' );
  20. echo $var;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement