SlideShare a Scribd company logo
1 of 9
Download to read offline
Creating a Button Shortcode
@laurenpittenger
Slides:
bit.ly/burbswpbuttonshortcode
What We Needed
What Didn’t Work So Well
What Didn’t Work So Well
What Didn’t Work So Well
Shortcode Approach
● Shortcode allows the user to create a button
without knowing how to code
● It can be placed anywhere in the content of a
post or page as well as in text widgets
function mytheme_button ($atts, $content = null) {
$atts = shortcode_atts( array('link' => '', 'color' => ''), $atts);
return '<a class="button ' . $color . '" href="' . $link . '">' .
do_shortcode($content) . '</a>';
}
add_shortcode( 'button', 'mytheme_button' );
The Code
Get the code on GitHub: bit.ly/buttonshortcode
[button link='http://linktosomething.com' color='orange']My Button Text![/button]
Final Result
Future Improvements

More Related Content

Similar to Creating a button shortcode

CSS Disable Button - How to Disable Buttons Using CSS - Blogs
CSS Disable Button - How to Disable Buttons Using CSS - BlogsCSS Disable Button - How to Disable Buttons Using CSS - Blogs
CSS Disable Button - How to Disable Buttons Using CSS - BlogsRonDosh
 
Web components with Angular
Web components with AngularWeb components with Angular
Web components with AngularAna Cidre
 
Devoxx 2014-webComponents
Devoxx 2014-webComponentsDevoxx 2014-webComponents
Devoxx 2014-webComponentsCyril Balit
 
User Login in PHP with Session & MySQL.pdf
User Login in PHP with Session & MySQL.pdfUser Login in PHP with Session & MySQL.pdf
User Login in PHP with Session & MySQL.pdfBe Problem Solver
 
Un-Framework - Delivering Dynamic Experiences with HTML over the Wire
Un-Framework - Delivering Dynamic Experiences with HTML over the WireUn-Framework - Delivering Dynamic Experiences with HTML over the Wire
Un-Framework - Delivering Dynamic Experiences with HTML over the WireAndreas Nedbal
 
WCMTL 15 - Create your own shortcode (Fr)
WCMTL 15 - Create your own shortcode (Fr)WCMTL 15 - Create your own shortcode (Fr)
WCMTL 15 - Create your own shortcode (Fr)MichaelBontyes
 
Writing a slack chatbot DrupalCampLA
Writing a slack chatbot DrupalCampLAWriting a slack chatbot DrupalCampLA
Writing a slack chatbot DrupalCampLAJesus Manuel Olivas
 
Html Server Button Control CS
Html Server Button Control CSHtml Server Button Control CS
Html Server Button Control CSsunmitraeducation
 
Balancing UX Consistency and Developer Productivity in a Design System
Balancing UX Consistency and Developer Productivity in a Design SystemBalancing UX Consistency and Developer Productivity in a Design System
Balancing UX Consistency and Developer Productivity in a Design Systemuxpin
 
Componentization css angular
Componentization css angularComponentization css angular
Componentization css angularDavid Amend
 
How to develop frontend application
How to develop frontend applicationHow to develop frontend application
How to develop frontend applicationSeokjun Kim
 
Hello I a having an issue with the code written in this ass.pdf
Hello I a having an issue with the code written in this ass.pdfHello I a having an issue with the code written in this ass.pdf
Hello I a having an issue with the code written in this ass.pdfabsgroup9793
 
WordPress and Shortcodes
WordPress and ShortcodesWordPress and Shortcodes
WordPress and ShortcodesJon Bishop
 
Noughts and Crosses Design Information
Noughts and Crosses Design InformationNoughts and Crosses Design Information
Noughts and Crosses Design InformationChristopher Orchard
 
Sketchmine: Design Systems Tooling
Sketchmine: Design Systems ToolingSketchmine: Design Systems Tooling
Sketchmine: Design Systems ToolingStefan Baumgartner
 
Learn to build a CodeIgniter Login and Registration with source code.pdf
Learn to build a CodeIgniter Login and Registration with source code.pdfLearn to build a CodeIgniter Login and Registration with source code.pdf
Learn to build a CodeIgniter Login and Registration with source code.pdfBe Problem Solver
 
Short Codes: Pain Free Magic
Short Codes: Pain Free MagicShort Codes: Pain Free Magic
Short Codes: Pain Free MagicMichael Susz
 

Similar to Creating a button shortcode (20)

CSS Disable Button - How to Disable Buttons Using CSS - Blogs
CSS Disable Button - How to Disable Buttons Using CSS - BlogsCSS Disable Button - How to Disable Buttons Using CSS - Blogs
CSS Disable Button - How to Disable Buttons Using CSS - Blogs
 
Web components with Angular
Web components with AngularWeb components with Angular
Web components with Angular
 
Devoxx 2014-webComponents
Devoxx 2014-webComponentsDevoxx 2014-webComponents
Devoxx 2014-webComponents
 
User Login in PHP with Session & MySQL.pdf
User Login in PHP with Session & MySQL.pdfUser Login in PHP with Session & MySQL.pdf
User Login in PHP with Session & MySQL.pdf
 
Un-Framework - Delivering Dynamic Experiences with HTML over the Wire
Un-Framework - Delivering Dynamic Experiences with HTML over the WireUn-Framework - Delivering Dynamic Experiences with HTML over the Wire
Un-Framework - Delivering Dynamic Experiences with HTML over the Wire
 
WCMTL 15 - Create your own shortcode (Fr)
WCMTL 15 - Create your own shortcode (Fr)WCMTL 15 - Create your own shortcode (Fr)
WCMTL 15 - Create your own shortcode (Fr)
 
Writing a slack chatbot DrupalCampLA
Writing a slack chatbot DrupalCampLAWriting a slack chatbot DrupalCampLA
Writing a slack chatbot DrupalCampLA
 
Intro to CSS
Intro to CSSIntro to CSS
Intro to CSS
 
TopicHero Descriptions Tutorial
TopicHero Descriptions TutorialTopicHero Descriptions Tutorial
TopicHero Descriptions Tutorial
 
Html Server Button Control CS
Html Server Button Control CSHtml Server Button Control CS
Html Server Button Control CS
 
Balancing UX Consistency and Developer Productivity in a Design System
Balancing UX Consistency and Developer Productivity in a Design SystemBalancing UX Consistency and Developer Productivity in a Design System
Balancing UX Consistency and Developer Productivity in a Design System
 
Componentization css angular
Componentization css angularComponentization css angular
Componentization css angular
 
How to develop frontend application
How to develop frontend applicationHow to develop frontend application
How to develop frontend application
 
Hello I a having an issue with the code written in this ass.pdf
Hello I a having an issue with the code written in this ass.pdfHello I a having an issue with the code written in this ass.pdf
Hello I a having an issue with the code written in this ass.pdf
 
WordPress and Shortcodes
WordPress and ShortcodesWordPress and Shortcodes
WordPress and Shortcodes
 
Noughts and Crosses Design Information
Noughts and Crosses Design InformationNoughts and Crosses Design Information
Noughts and Crosses Design Information
 
Sketchmine: Design Systems Tooling
Sketchmine: Design Systems ToolingSketchmine: Design Systems Tooling
Sketchmine: Design Systems Tooling
 
Writing a slack chatbot mxlos
Writing a slack chatbot mxlosWriting a slack chatbot mxlos
Writing a slack chatbot mxlos
 
Learn to build a CodeIgniter Login and Registration with source code.pdf
Learn to build a CodeIgniter Login and Registration with source code.pdfLearn to build a CodeIgniter Login and Registration with source code.pdf
Learn to build a CodeIgniter Login and Registration with source code.pdf
 
Short Codes: Pain Free Magic
Short Codes: Pain Free MagicShort Codes: Pain Free Magic
Short Codes: Pain Free Magic
 

More from Lauren Pittenger

Systems + Processes for Creatives – WordCamp Philadelphia 2017
Systems + Processes for Creatives – WordCamp Philadelphia 2017Systems + Processes for Creatives – WordCamp Philadelphia 2017
Systems + Processes for Creatives – WordCamp Philadelphia 2017Lauren Pittenger
 
Using Github to Share Talk Ideas
Using Github to Share Talk IdeasUsing Github to Share Talk Ideas
Using Github to Share Talk IdeasLauren Pittenger
 
What The Flexbox? An Intro to Flexbox
What The Flexbox? An Intro to FlexboxWhat The Flexbox? An Intro to Flexbox
What The Flexbox? An Intro to FlexboxLauren Pittenger
 
Web Hosting for WordPress: WP Engine
Web Hosting for WordPress: WP EngineWeb Hosting for WordPress: WP Engine
Web Hosting for WordPress: WP EngineLauren Pittenger
 
A Single Div: A Learning Experiment
A Single Div: A Learning ExperimentA Single Div: A Learning Experiment
A Single Div: A Learning ExperimentLauren Pittenger
 
The Art of Minimalist Design
The Art of Minimalist DesignThe Art of Minimalist Design
The Art of Minimalist DesignLauren Pittenger
 
Using Slickplan to Help Plan a Website Redesign
Using Slickplan to Help Plan a Website RedesignUsing Slickplan to Help Plan a Website Redesign
Using Slickplan to Help Plan a Website RedesignLauren Pittenger
 
Systems + Processes for Creatives – WordCamp Pittsburgh 2017
Systems + Processes for Creatives – WordCamp Pittsburgh 2017Systems + Processes for Creatives – WordCamp Pittsburgh 2017
Systems + Processes for Creatives – WordCamp Pittsburgh 2017Lauren Pittenger
 
Getting Started Speaking Workshop - ELA Conf
Getting Started Speaking Workshop - ELA ConfGetting Started Speaking Workshop - ELA Conf
Getting Started Speaking Workshop - ELA ConfLauren Pittenger
 
Birthing a Child Theme - WordCamp Scranton
Birthing a Child Theme - WordCamp ScrantonBirthing a Child Theme - WordCamp Scranton
Birthing a Child Theme - WordCamp ScrantonLauren Pittenger
 
Command Line for Designers - WordCamp Philly
Command Line for Designers - WordCamp PhillyCommand Line for Designers - WordCamp Philly
Command Line for Designers - WordCamp PhillyLauren Pittenger
 
Command Line for Designers - WordCamp NYC
Command Line for Designers - WordCamp NYCCommand Line for Designers - WordCamp NYC
Command Line for Designers - WordCamp NYCLauren Pittenger
 

More from Lauren Pittenger (15)

Systems + Processes for Creatives – WordCamp Philadelphia 2017
Systems + Processes for Creatives – WordCamp Philadelphia 2017Systems + Processes for Creatives – WordCamp Philadelphia 2017
Systems + Processes for Creatives – WordCamp Philadelphia 2017
 
Using Github to Share Talk Ideas
Using Github to Share Talk IdeasUsing Github to Share Talk Ideas
Using Github to Share Talk Ideas
 
What The Flexbox? An Intro to Flexbox
What The Flexbox? An Intro to FlexboxWhat The Flexbox? An Intro to Flexbox
What The Flexbox? An Intro to Flexbox
 
Web Hosting for WordPress: WP Engine
Web Hosting for WordPress: WP EngineWeb Hosting for WordPress: WP Engine
Web Hosting for WordPress: WP Engine
 
PSD to WordPress Theme
PSD to WordPress ThemePSD to WordPress Theme
PSD to WordPress Theme
 
A Single Div: A Learning Experiment
A Single Div: A Learning ExperimentA Single Div: A Learning Experiment
A Single Div: A Learning Experiment
 
My Favorite Design Tools
My Favorite Design ToolsMy Favorite Design Tools
My Favorite Design Tools
 
The Art of Minimalist Design
The Art of Minimalist DesignThe Art of Minimalist Design
The Art of Minimalist Design
 
WordPress Child Themes
WordPress Child ThemesWordPress Child Themes
WordPress Child Themes
 
Using Slickplan to Help Plan a Website Redesign
Using Slickplan to Help Plan a Website RedesignUsing Slickplan to Help Plan a Website Redesign
Using Slickplan to Help Plan a Website Redesign
 
Systems + Processes for Creatives – WordCamp Pittsburgh 2017
Systems + Processes for Creatives – WordCamp Pittsburgh 2017Systems + Processes for Creatives – WordCamp Pittsburgh 2017
Systems + Processes for Creatives – WordCamp Pittsburgh 2017
 
Getting Started Speaking Workshop - ELA Conf
Getting Started Speaking Workshop - ELA ConfGetting Started Speaking Workshop - ELA Conf
Getting Started Speaking Workshop - ELA Conf
 
Birthing a Child Theme - WordCamp Scranton
Birthing a Child Theme - WordCamp ScrantonBirthing a Child Theme - WordCamp Scranton
Birthing a Child Theme - WordCamp Scranton
 
Command Line for Designers - WordCamp Philly
Command Line for Designers - WordCamp PhillyCommand Line for Designers - WordCamp Philly
Command Line for Designers - WordCamp Philly
 
Command Line for Designers - WordCamp NYC
Command Line for Designers - WordCamp NYCCommand Line for Designers - WordCamp NYC
Command Line for Designers - WordCamp NYC
 

Recently uploaded

Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 

Creating a button shortcode