27
DON’T TYPE IT OVER AND OVER Chad Haefele Interim Head of User Experience UNC Chapel Hill Libraries [email protected] Working with Shortcodes in WordPress

Working with Shortcodes in WordPress

Embed Size (px)

Citation preview

Page 1: Working with Shortcodes in WordPress

DON’T TYPE IT OVER AND OVER

Chad HaefeleInterim Head of User ExperienceUNC Chapel Hill [email protected]

Working with Shortcodes in WordPress

Page 2: Working with Shortcodes in WordPress

Previously on Florida Library Webinars…

https://floridalibrarywebinars.org/building-a-library-website-in-wordpress-ondemand/

Page 3: Working with Shortcodes in WordPress

Previously on Florida Library Webinars…

https://floridalibrarywebinars.org/media-in-wordpress-ondemand/

Page 4: Working with Shortcodes in WordPress

HiddenPeanuts.combit.ly/wp4lib

Page 5: Working with Shortcodes in WordPress
Page 6: Working with Shortcodes in WordPress
Page 7: Working with Shortcodes in WordPress
Page 8: Working with Shortcodes in WordPress

[BuildingPolicies]

Page 9: Working with Shortcodes in WordPress

What would you use one for?

•Policies•Widgets

•Twitter•Libraryh3lp

•Galleries•Library hours•Library events

Page 10: Working with Shortcodes in WordPress

Components of other plugins• Formidable• Elegant Themes

• $89/year• 3D Viewer: [stl file="/2016/09/filename.stl" ]

Page 11: Working with Shortcodes in WordPress

Working with 3D Models

Page 12: Working with Shortcodes in WordPress

<img src =“wordpress.png” alt=“WordPress logo”>

Page 13: Working with Shortcodes in WordPress

[audio][video]

Page 14: Working with Shortcodes in WordPress

.com usage• Video

• en.support.wordpress.com/videos/ • Audio

• en.support.wordpress.com/audio/

Page 15: Working with Shortcodes in WordPress

.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

Page 16: Working with Shortcodes in WordPress

[gallery]

Page 17: Working with Shortcodes in WordPress

Installing & Using Shortcodes UIwordpress.org/plugins/shortcodes-ui/

Page 18: Working with Shortcodes in WordPress

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.

Page 19: Working with Shortcodes in WordPress

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.

Page 20: Working with Shortcodes in WordPress

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/

Page 21: Working with Shortcodes in WordPress

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

Page 22: Working with Shortcodes in WordPress

[gallery]

Page 23: Working with Shortcodes in WordPress

[[gallery]]

Page 24: Working with Shortcodes in WordPress

HiddenPeanuts.combit.ly/wp4lib

Page 27: Working with Shortcodes in WordPress

DON’T TYPE IT OVER AND OVER

Chad HaefeleInterim Head of User ExperienceUNC Chapel Hill [email protected]

Working with Shortcodes in WordPress

Slides: