working with shortcodes in wordpress
TRANSCRIPT
DON’T TYPE IT OVER AND OVER
Chad HaefeleInterim Head of User ExperienceUNC Chapel Hill [email protected]
Working with Shortcodes in WordPress
Previously on Florida Library Webinars…
https://floridalibrarywebinars.org/building-a-library-website-in-wordpress-ondemand/
Previously on Florida Library Webinars…
https://floridalibrarywebinars.org/media-in-wordpress-ondemand/
HiddenPeanuts.combit.ly/wp4lib
[BuildingPolicies]
What would you use one for?
•Policies•Widgets
•Twitter•Libraryh3lp
•Galleries•Library hours•Library events
Components of other plugins• Formidable• Elegant Themes
• $89/year• 3D Viewer: [stl file="/2016/09/filename.stl" ]
Working with 3D Models
<img src =“wordpress.png” alt=“WordPress logo”>
[audio][video]
.com usage• Video
• en.support.wordpress.com/videos/ • Audio
• en.support.wordpress.com/audio/
.org usage (built-in)• Video
• codex.wordpress.org/Audio_Shortcode• Audio
• codex.wordpress.org/Video_Shortcode• Other built-in shortcodes
• Caption• Embed: https://codex.wordpress.org/Embeds • Playlist: https://codex.wordpress.org/Playlist_Shortcode • Gallery: https://codex.wordpress.org/Gallery_Shortcode
[gallery]
Installing & Using Shortcodes UIwordpress.org/plugins/shortcodes-ui/
Build a basic text substitution shortcode
1. Put your reusable text in the top edit box2. Set the ShortCode Type dropdown to Simple Snippet3. Choose a ShortCode Tag – this is the text you’ll use to
trigger your Shortcode4. Click the Publish button5. Go put [YourShortcodeTag] somewhere in a Page or
Post.
Build a Twitter widget shortcode1. Get the code for your Twitter widget from
twitter.com/settings/widgets 2. Put your Twitter widget code in the top edit box3. Set the ShortCode Type dropdown to Simple Snippet4. Choose a ShortCode Tag – this is the text you’ll use to
trigger your Shortcode5. Click the Publish button6. Go put [YourShortcodeTag] somewhere in a Page or
Post.
Enable shortcodes in WP widgetsWARNING! THIS COULD BREAK THINGS!1. Under Appearance, go to Editor2. Edit your functions.php file (it might be called Theme
Functions)3. Add this code near the top of the file:
// Enable shortcodes in widgets add_filter('widget_text', 'do_shortcode');
4. Click Update File
Alternatively, use this plugin: wordpress.org/plugins/shortcode-widget/
Build a libraryh3lp shortcode (advanced!)
1. Set the ShortCode Type dropdown to Simple One Tag ShortCode2. Give your Shortcode this tag: libraryh3lp3. Paste one of your libraryh3lp code snippets in the ShortCode
Template box4. In your libraryh3lp snippet, replace the ID number with {id}5. Scroll down to ShortCode Attributes, click the plus button6. Fill in:
1. Name: id2. Default Value: 0
7. Click Publish or Update8. Find the id of the libraryh3lp snippet you want to embed9. On any WordPress Page, put [libraryh3lp id=“1234”], replacing
your snippet ID as appropriate
[gallery]
[[gallery]]
HiddenPeanuts.combit.ly/wp4lib
https://floridalibrarywebinars.org/building-a-library-website-in-wordpress-ondemand/
https://floridalibrarywebinars.org/media-in-wordpress-ondemand/
DON’T TYPE IT OVER AND OVER
Chad HaefeleInterim Head of User ExperienceUNC Chapel Hill [email protected]
Working with Shortcodes in WordPress
Slides: