Sidebar & Widgets Shortcode
Two shortcodes for WordPress that will allow you to call sidebars or widget areas from the WordPress editor.
Copy the code from the files into your WordPress theme or plug-in.This is now a plugin! Just added to your plugins directory and activate!
- That's it!
For the sidebar shortcode: [sidebar_shortcode name=SIDEBARID]. Replace SIDEBARID with the sidebar's ID. For the widgets shortcode: [widgets_shortcode name=SIDEBARID]. Replace SIDEBARID with the sidebar's (or widget area's) ID.
- I would recommend prefixing the shortcodes and the functions to avoid conflicts with other plugins or theme code.
- I wrote a blog post that explains everything here: Include a Sidebar with a Shortcode in WordPress
- This, like WordPress, is released under the GPL.
-- Version 1.1 --
- Now plugin-ified!
- Added jc_ prefix to functions.