SlideShare a Scribd company logo
WordPress and Shortcodes Creating Better Content  w/ Shortcodes via J Shortcodes
What Is The Problem? WordPress users with minimal HTML experience spend too much time trying to format content.
What Are Shortcodes? Bits of code you use in the WordPress visual editor to generate dynamic content on the front end. HTML: Shortcode: Result:
Why Are Shortcodes Useful? Easy to use Easy to create Simplify repetitive tasks
Built-In WordPress.com Shortcodes Misc Shortcodes: [archives] [contact-form] [digg] [googlemaps] [polldaddy] [sourcecode][/sourcecode] Assortment of Shortcodes for: Images Videos Audio
Built-In WordPress.org Shortcodes [gallery] The [gallery] shortcode is used in a Post or Page to display a thumbnail gallery of images attached to that post.
Using Shortcodes Enclosed/Self-Enclosed [shortcode]Some Content[/shortcode] [shortcode] Attributes [shortcode option1="something" option2="more"] [shortcode option1="more"]Some Content[/shortcode]
Creating Simple Shortcodes function wpb_shortcode() {      return 'Hi WPBoston Meetup!'; } add_shortcode('wpb', 'wpb_shortcode'); Now use can use [wpb] in your posts & pages to display the returned content from our wpb_boston function.
Creating Advanced Shortcodes function link_shortcode($atts, $content = null) {     extract(shortcode_atts(          array(               'class' => 'link',              'href' => '#'           ),           $atts      ));      return '<a href=&quot;'.$href.'&quot; class=&quot;'.$class.'&quot;>'.$content.'</a>'; } add_shortcode('link', 'link_shortcode'); Now use can use [link] in your posts & pages to display the returned content from our link_shortcode function
Real World Examples Turn This Into This via Striking Theme
Examples cont. Buttons via ElegantThemes Content Boxes via J Shortcodes
Examples cont. Icon Lists via Showtime Theme Columns via Awake Theme
Examples cont. Drop Caps via Striking Theme Quotes via Avisio Theme
Examples cont. Pricing Table via ElegantThemes Author Info via HubSpot for WordPress Plugin
Examples cont. Contact Forms via inFocus Theme Tabs via  DynamiX Theme
Other Cool Uses Advertising Social Media Buttons Calls to Action Posts from RSS Hiding Private Content
Potential Pitfalls w/ Shortcodes Themes vs Plugins Nesting Usability
Making Shortcodes Even Easier Using a UI to manage and insert shortcodes via ElegantThemes
Making Shortcodes Even Easier cont. via Striking Theme via HubSpot for WordPress Plugin
Shortcode Tips & Tricks The following will execute all shortcodes in a string of text: do_shortcode('Text with a [shortcode] in it'); Use this to run shortcodes in a text widget: add_filter('widget_text', 'do_shortcode'); Execute a shortcode anywhere in your template files: do_shortcode('[shortcode]');
Thanks! Jon Bishop Web Developer in Boston Area WordPress Plugins: Socialize HubSpot for WordPress Website / JonBishop.com Newsletter / WPBusiness.info Twitter / @JonDBishop

More Related Content

PPT
Creating Content With Shortcodes
PDF
HTML lets get creative!!
POT
Plantilla Power XLV
PPTX
Introduction to OAuth 2.0 - Part 1
PDF
Common html
PDF
Introduction to OAuth 2.0 - Part 1
PDF
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...
PPTX
BASIC HTML PRESENTATION
Creating Content With Shortcodes
HTML lets get creative!!
Plantilla Power XLV
Introduction to OAuth 2.0 - Part 1
Common html
Introduction to OAuth 2.0 - Part 1
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...
BASIC HTML PRESENTATION

What's hot (8)

PPT
Wordpress.Com
PPT
Mobile App Development with WordPress data
PPTX
Web scraping
PPT
CIS 451: Introduction to ASP.NET
PDF
Introduction to OAuth 2.0 - Part 2
PPTX
How to change reply text in word press comments
PDF
How to Re-Order wordpress posts by custom field
PPTX
Tech recommendation
Wordpress.Com
Mobile App Development with WordPress data
Web scraping
CIS 451: Introduction to ASP.NET
Introduction to OAuth 2.0 - Part 2
How to change reply text in word press comments
How to Re-Order wordpress posts by custom field
Tech recommendation
Ad

Viewers also liked (8)

PPT
WordCamp Boston 2012 - Creating Content With Shortcodes
PPTX
Did wordpressdothat
PPTX
Microsoft Exam 70-331 Exam Cram Study Guide
PPTX
Exam Cram for 70-488: Developing Microsoft SharePoint Server 2013 Core Solutions
PPTX
SharePoint Publishing 101
PPTX
Help! I've got a share point site! Now What?
PPTX
SharePoint and Open XML
PPTX
Developing retention rules that work
WordCamp Boston 2012 - Creating Content With Shortcodes
Did wordpressdothat
Microsoft Exam 70-331 Exam Cram Study Guide
Exam Cram for 70-488: Developing Microsoft SharePoint Server 2013 Core Solutions
SharePoint Publishing 101
Help! I've got a share point site! Now What?
SharePoint and Open XML
Developing retention rules that work
Ad

Similar to WordPress and Shortcodes (20)

PDF
Shortcodes: WordUp Pompey! Feb-2012
PPTX
Wordpress Shortcode
PPTX
TopicHero Descriptions Tutorial
PPTX
Shortcodes vs Widgets: Which one and how?
PDF
Introduction to html5
PPTX
Conquering Code with hjc
PDF
IT230-Assignment 1 Solved.pdf
PPT
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
PPTX
workshopsisnotreallyrrwardingitsinot.pptx
PPTX
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
PPTX
Introduction to HTML+CSS+Javascript.pptx
PPTX
Introduction to HTML+CSS+Javascript.pptx
PPTX
wd project.pptx
PPTX
juststartpdfisntofdsjjslfjslfslflsdf.pptx
PPT
331592291-HTML-and-Cascading style sheet
PPTX
INTRODUCTIONS OF HTML
PPTX
Web Development Course - HTML5 & CSS3 by RSOLUTIONS
PPT
Automatic Code Generation
PDF
How to Convert a Component Design into an MUI React Code
PPTX
Developing branding solutions for 2013
Shortcodes: WordUp Pompey! Feb-2012
Wordpress Shortcode
TopicHero Descriptions Tutorial
Shortcodes vs Widgets: Which one and how?
Introduction to html5
Conquering Code with hjc
IT230-Assignment 1 Solved.pdf
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
workshopsisnotreallyrrwardingitsinot.pptx
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
Introduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptx
wd project.pptx
juststartpdfisntofdsjjslfjslfslflsdf.pptx
331592291-HTML-and-Cascading style sheet
INTRODUCTIONS OF HTML
Web Development Course - HTML5 & CSS3 by RSOLUTIONS
Automatic Code Generation
How to Convert a Component Design into an MUI React Code
Developing branding solutions for 2013

Recently uploaded (20)

PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Electronic commerce courselecture one. Pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Building Integrated photovoltaic BIPV_UPV.pdf
A Presentation on Artificial Intelligence
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Electronic commerce courselecture one. Pdf
Advanced methodologies resolving dimensionality complications for autism neur...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Encapsulation_ Review paper, used for researhc scholars
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Network Security Unit 5.pdf for BCA BBA.
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
20250228 LYD VKU AI Blended-Learning.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Encapsulation theory and applications.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
NewMind AI Monthly Chronicles - July 2025

WordPress and Shortcodes

  • 1. WordPress and Shortcodes Creating Better Content  w/ Shortcodes via J Shortcodes
  • 2. What Is The Problem? WordPress users with minimal HTML experience spend too much time trying to format content.
  • 3. What Are Shortcodes? Bits of code you use in the WordPress visual editor to generate dynamic content on the front end. HTML: Shortcode: Result:
  • 4. Why Are Shortcodes Useful? Easy to use Easy to create Simplify repetitive tasks
  • 5. Built-In WordPress.com Shortcodes Misc Shortcodes: [archives] [contact-form] [digg] [googlemaps] [polldaddy] [sourcecode][/sourcecode] Assortment of Shortcodes for: Images Videos Audio
  • 6. Built-In WordPress.org Shortcodes [gallery] The [gallery] shortcode is used in a Post or Page to display a thumbnail gallery of images attached to that post.
  • 7. Using Shortcodes Enclosed/Self-Enclosed [shortcode]Some Content[/shortcode] [shortcode] Attributes [shortcode option1=&quot;something&quot; option2=&quot;more&quot;] [shortcode option1=&quot;more&quot;]Some Content[/shortcode]
  • 8. Creating Simple Shortcodes function wpb_shortcode() {     return 'Hi WPBoston Meetup!'; } add_shortcode('wpb', 'wpb_shortcode'); Now use can use [wpb] in your posts & pages to display the returned content from our wpb_boston function.
  • 9. Creating Advanced Shortcodes function link_shortcode($atts, $content = null) {     extract(shortcode_atts(          array(               'class' => 'link',              'href' => '#'           ),           $atts      ));      return '<a href=&quot;'.$href.'&quot; class=&quot;'.$class.'&quot;>'.$content.'</a>'; } add_shortcode('link', 'link_shortcode'); Now use can use [link] in your posts & pages to display the returned content from our link_shortcode function
  • 10. Real World Examples Turn This Into This via Striking Theme
  • 11. Examples cont. Buttons via ElegantThemes Content Boxes via J Shortcodes
  • 12. Examples cont. Icon Lists via Showtime Theme Columns via Awake Theme
  • 13. Examples cont. Drop Caps via Striking Theme Quotes via Avisio Theme
  • 14. Examples cont. Pricing Table via ElegantThemes Author Info via HubSpot for WordPress Plugin
  • 15. Examples cont. Contact Forms via inFocus Theme Tabs via  DynamiX Theme
  • 16. Other Cool Uses Advertising Social Media Buttons Calls to Action Posts from RSS Hiding Private Content
  • 17. Potential Pitfalls w/ Shortcodes Themes vs Plugins Nesting Usability
  • 18. Making Shortcodes Even Easier Using a UI to manage and insert shortcodes via ElegantThemes
  • 19. Making Shortcodes Even Easier cont. via Striking Theme via HubSpot for WordPress Plugin
  • 20. Shortcode Tips & Tricks The following will execute all shortcodes in a string of text: do_shortcode('Text with a [shortcode] in it'); Use this to run shortcodes in a text widget: add_filter('widget_text', 'do_shortcode'); Execute a shortcode anywhere in your template files: do_shortcode('[shortcode]');
  • 21. Thanks! Jon Bishop Web Developer in Boston Area WordPress Plugins: Socialize HubSpot for WordPress Website / JonBishop.com Newsletter / WPBusiness.info Twitter / @JonDBishop

Editor's Notes

  • #2: Intro: WordPress allows me to enable my customers to take control of content they previously had no control over Shortcodes are one of the ways I give my customers control over their content What do I mean by better content? Mostly I just mean better looking content but you can also have access to content that was previously harder to display on your WordPress site.
  • #4: Shortcodes were added in WordPress 2.5 as an easy way to create macros for use in your content.
  • #5: Easy to use: With only a few keystrokes you can create and test your shortcodes. Easy to create: Shortcodes are easy to create and with a little know-how you can convert previously repetitive tasks into easy to use shortcodes Simplify repetitive tasks: Rather than have my clients copy and paste chunks of code to recreate buttons or text boxes on their sites they can simply reuse the same shortcodes which are a lot easier to remember and involve a lot less code on their end
  • #6: Jetpack Plugin
  • #9: You associate your shortcode with a handler using add_shortcode.
  • #18: If you are using shortcodes provided by a theme you are potentially bound to that theme unless you change your content or find a theme with the same shortcode syntax Your handler needs to call do_shortcode