Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   New Versions, & Updating (http://forum.bytesforall.com/forumdisplay.php?f=12)
-   -   Feature Request: Shortcodes in Widgets (http://forum.bytesforall.com/showthread.php?t=11200)

startack Nov 16, 2010 04:53 PM

Feature Request: Shortcodes in Widgets
 
It's a short bit of code that increases the number of plugins you can use and it saves you from having to find as many plugins with widget options.

You do have to add it to functions.php which is why I'm putting it in as a feature request

http://www.wprecipes.com/how-to-add-...idebar-widgets

All you add is:

Code:

add_filter('widget_text', 'do_shortcode');

lmilesw Nov 17, 2010 07:11 AM

I can't be sure but I suspect WordPress has reasons for not allowing this by default. You can alternatively use this plugin.

nickcroker Dec 7, 2010 04:53 AM

I simply cannot get shortcodes to work in sidebar text widgets.

I'm trying to call [highslide] plugin from text sidebar widget (or advanced text widget - tried both).

I've tried adding:
add_filter('widget_text', 'do_shortcode'); to functions.php

I've tried using advanced text widget and numerous other plugins to enable shortcodes in text widgets without luck.

I'm guessing it's a plugin conflict somewhere.

Using WP 3.02 and Atahualpa 3.4.9

Anyone clues very gratefully received.
Nick

juggledad Dec 7, 2010 06:39 AM

Wordpress doesn't process shortcodes in text widgets. Try this, add
HTML Code:

<?php add_filter(‘widget_text’, ‘do_shortcode’); ?>
To the end of “functions.php” and see if it works.

lmilesw Dec 7, 2010 10:25 AM

Also see post #2

nickcroker Dec 8, 2010 05:02 AM

Quote:

Originally Posted by juggledad (Post 51388)
Wordpress doesn't process shortcodes in text widgets. Try this, add
HTML Code:

<?php add_filter(‘widget_text’, ‘do_shortcode’); ?>
To the end of “functions.php” and see if it works.

Tried that - no joy.

Also tried various plugins but all I get is the shortcode being displayed [shortcode]blah blah blah[/shortcode] as plain text.

Very frustrating for something I'm thinking should be simple to implement.

I'll keep experimenting.
Thanks,
Nick

juggledad Dec 8, 2010 05:33 AM

Highslide uses a tag (<highslide>) not a shortcode ([highslide])

nickcroker Dec 9, 2010 05:02 AM

Quote:

Originally Posted by juggledad (Post 51475)
Highslide uses a tag (<highslide>) not a shortcode ([highslide])

I'm using Highslide for WordPress *reloaded*
which uses a shortcode [highslide] if I want to use HTML in my popup - see near bottom of linked page.

lmilesw Dec 9, 2010 07:25 AM

Since the sidebar shortcode plugin always worked before I unfortunately assumed it would work with this so I installed Highslide 4 WordPress Reloaded and found out like you that it didn't so I tried what is fast becoming my favorite way to create sidebar content.

I use the Spectacu.la Page Widget plugin. you just create a page with the Highslide shortcode in it. Then you go to Appearance>Widgets and add the Spectacu.la widget to the sidebar and point it to the page you just created. Worked great for me.

nickcroker Dec 10, 2010 04:38 AM

Quote:

Originally Posted by lmilesw (Post 51597)
Since the sidebar shortcode plugin always worked before I unfortunately assumed it would work with this so I installed Highslide 4 WordPress Reloaded and found out like you that it didn't so I tried what is fast becoming my favorite way to create sidebar content.

I use the Spectacu.la Page Widget plugin. you just create a page with the Highslide shortcode in it. Then you go to Appearance>Widgets and add the Spectacu.la widget to the sidebar and point it to the page you just created. Worked great for me.

Fantastic! I'll give that a try. Thanks.

nickcroker Dec 10, 2010 06:03 AM

The good news - it worked :)

The bad news - highslide crashes/corrupts pages and posts if the content to be 'highslided' is more than 500 or so words :(

So I'm still searching for a 'popup' plugin that will show the heading and body content of a page/post when the user clicks a link in my sidebar.

However I do love the Spectacu.la page plugin!
Nick

lmilesw Dec 10, 2010 09:38 AM

What was the code you used for highslide to open a page in a window? Have you tried shadowbox js. It will open a url in a modal window.

polins Oct 22, 2011 08:11 AM

I use the extra plugin "Shortcodes in Sidebar Widgets" to solve this problem. It works in the background once installed.
ATA 3.6.4, WP 3.1

Knut Sparhell Oct 25, 2011 02:39 AM

FYI: Shortcodes will work for text widgets in WP 3.3


All times are GMT -6. The time now is 08:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.