Jump to content
Sign in to follow this  
dtraub

iBlog Widget Shortcodes

Recommended Posts

dtraub

How can I enable the use of a shortcode in a sidebar widget. I tried adding "add_filter('widget_text', 'do_shortcode');) to the funtions.php file but the shortcode is showing on the site as text. I tested the exact shortcode on a page and it worked.

Share this post


Link to post
Share on other sites
Andrew

is 'widget_text' the appropriate hook? Are you on iBlogPro?

Share this post


Link to post
Share on other sites
dtraub

I am on iBlogPro. I'm not sure if it is nor not... I found that code snipit several places as what to put into the functions to allow shortcodes in the text widget. The particular plugin that I'm trying to access is AmazonSimpleAdmin if that matters.

Share this post


Link to post
Share on other sites
dtraub

Some more playing and it still doesn't work, but I discovered something wierd. I in a text widget I put: [asa]1593302002[/asa] [mm-breaking-news] the asa is the shortcode for the amazonsimpleadmin plugin mm-breaking-news is the shortcode for the MM-Breaking News plugin I then took the same exact text and put it on a new page. When I go to the test page it works flawlessly in the page content. In the text sidebar the amazonsimpleadmin just displays the [asa]1593302002[/asa]. The MM-Breaking News shortcode though has been replaced with what it should have.

Share this post


Link to post
Share on other sites
justme

I don't know that plugin but noticed a couple of things. 1. Compatible up to 2.8.3 (I know this may or may not make a difference) 2. Requires PHP 5.1.4 or higher

Share this post


Link to post
Share on other sites
cmunns

No, it sounds like a markup issue with the widgets/sidebars if it's displaying the code as text. I know we might have said this in a different post, but did you make sure the widgets you are using have titles?

Share this post


Link to post
Share on other sites
dtraub

I hadn't thought about the widget title... it did not have one, but does now and it still did not work.

Share this post


Link to post
Share on other sites
cmunns

Okay, you mind providing a link to the site, I need to see the source code.

Share this post


Link to post
Share on other sites
dtraub

Sure. The site is sellingbrilliantly.com I setup a test page at TestPage which is the only page that has the widget on it. It's currently in the content sidebar, but I had the same problem in the flow sidebar.

Share this post


Link to post
Share on other sites
Andrew

did you add this code to your functions.php file? ` add_filter( 'widget_text', 'shortcode_unautop'); add_filter( 'widget_text', 'do_shortcode'); ` probably towards the top is better.

Share this post


Link to post
Share on other sites
dtraub

Near the top is where I put it.

Share this post


Link to post
Share on other sites
Andrew

hmm.. this is a tough one. Most likely a wp issue (not theme) problem. Did you try this on the WP forum? I will look into it further.

Share this post


Link to post
Share on other sites
dtraub

Thanks. I've not tried over there. Frankly everytime I try the forums over there I end up more lost than when I started. Also I figured that if the shortcodes worked in the page (which they do) that it meant something else was interfering and I already tried disabling all my plugins to see if that would help and it didn't.

Share this post


Link to post
Share on other sites
cmunns

You can try enabling another theme and testing there to see if it is the theme or WP?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×