5. Problems: Html/css code
• WordPress user with minimal html experience
spend too much time trying to create and
format content
6. Outline
• What Shortcode ?
• Why Shortcode ?
• Layout & Style with Shortcode
• Shortcode on Widget
• Some useful Shortcode
• Shortcode Best practices
• Create Shortcode for your own
• Q/A
7. What is shortcode ?
Very simple code use in post’s content to create special
things
8. What is shortcode?
• Shortcode is [Tag]
• May be have enclose tag like this: [tag]content[/tag]
• May be have attributes like this: [tag attribute1=“abc”]
• Many be in other shortcode:
[tag-parent]
[tag-child]
[/tag-parent]
13. Why Shortcode ?
• Easy use to format content
• It’s text, It can use any where (Page/Post/Widget)
• It’s simple
• It’s easy to create
• Clean up your post’s content
17. Turn on Widget Short code
• Solution 1: for Dev
add_filter( 'widget_text', 'shortcode_unautop' );
add_filter( 'widget_text', 'do_shortcode' );
• Solution 2: for User
Install plugin:
+ Ultimate Short code
+ Short code Widget
23. Best practices with Shortcode
• Don’t use shortcode in theme.
• When you change theme ? Use plugin
• Hide broken shortcodes: Hide Broken Shortcodes Plugin