Where does the shortcode for a custom widget go?
From this thread
http://forum.bytesforall.com/showthr...dget+shortcode It says: "Once you have created the new widget area, copy paste the shortcode [FrontpageSlideshow] into the widget." I have a custom widget in my header area fine. Now I am trying to add the shortcode. Where the heck does the short code go? The plugin is wp-imageflow2 and the gallery has been uploaded to wp-content/galleryimageflow2??? |
do you have a custom widget or a custom widget AREA? if you have a new widget area, then you need to add some widget not it. You might need a text widget in this situation
|
I think I have a custom widget area called my_header_widget to which I added a text widget,
then tried adding the shortcode to the text widget. The result of doing that was the shortcode appeared on the page exactly as I entered it instead of the gallery. I've been looking on the internet and I found this suggestion from stephanie leary who writes books about wordpress. "Shortcodes are bracketed placeholders you can use while editing your content that will be replaced with some other, more complicated content (like an embedded video or image gallery) when your post is displayed to visitors. Unfortunately, shortcodes are processed only in post/page content. You can use them in text widgets, however, if you enable theme in the theme functions as shown in Listing 6-39. Listing 6-39. Enabling shortcode parsing in text widgets add_filter('widget_text', 'shortcode_unautop'); add_filter('widget_text', 'do_shortcode'); The first line ensures that a shortcode placed by itself on its own line won’t be surrounded by paragraph tags. The second line actually parses the shortcode. I added the two lines of code to the themes functions.php file but that didn't work either. the images for the plugin which is wp-imageflow2 are in wp-content/galleryimageflow2 and the shortcode I tried was [wp-imageflow2 dir=wp-content/galleryimageflow2] Help is greatly appreciated. |
site is jkstest.info
|
A shortcode cannot be natively used in the standard text widget. To use a shortcode in a widget you either need to install a plugin that "enables" that option such as Shortcodes in Sidebar Widgets or using code like
PHP Code:
|
I've installed the "shortcodes in sidebar widget" as you suggested.The gallery still doesn't show up.
How do i know if I have a "php aware" widget to attempt to try to figure out where I would insert the <?php echo do_shortcode('[your shortcode]'); ?> code that you suggest? The widget area is My_header_widget. |
The Linkable title widget I mentioned is a php aware widget.
|
All times are GMT -6. The time now is 05:20 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.