Hey,
I have a little problem and for the life of me I can’t find a solution. I have a custom box (textarea) in my theme options page and users can insert html & shortcodes that are displayed on the front page. But, I have a user that on his server the shortcodes will not execute. It is just echoing the shortcode instead.
Here’s my code:
<?php echo do_shortcode($data['custom_section_content']); ?>
It’s the firs time this is happening.
Any of you have any ideas?
Thanks and cheers!
could it be on the excerpt possibly?
http://wordpress.org/support/topic/shortcodes-dont-work-in-excerptsThanks for the answer but no, it isnt’t in the excertpt. It’s in the theme options area.
Cheers!
- Grew a moustache for the Envato Movember competition
- Community Moderator
- Contributed a Blog Post
- Author was Featured
- Item was Featured
- Won a Competition
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Has been a member for 4-5 years
oh oh oh! I had this same problem. It was something silly I did…. ummmmmmmmmm * searches *
edit: it was this problem I was having: http://themeforest.net/forums/thread/wp-shortcode-contactform7-doesnt-work-in-theme/62795
but for the life of me I cannot figure out how I fixed it. hmmm
edit2: i can only suggest swapping back to the default theme, implement just that bit of code you’re trying to do, and see if it works or not.
Thanks for your reply.
I’ve tried 100 solutions 
The shortcodes work perfect on my local xampp install and all of my servers. I guess they work on 99,9% of the users using the theme. There is only 1 user that sent me this problem. He gave me a test username and pw on his site and I’ve tried almost anything and I’m yet to find a fix. I have never encountered this.
Oh, and the shortcodes work fine in posts or pages. They just don’t work anywhere else when called with “echo do_shortcode”. None of them. It is simply echoing the shortcode.
I think I’m going crazy. I won’ have rest until I find the fix 
Cheers!
Oh, and the shortcodes work fine in posts or pages. They just don’t work anywhere else when called with “echo do_shortcode”. None of them. It is simply echoing the shortcode.
Clearly that points to a problem with the function echo do_shortcode? Does it not?
Just speaking out aloud.
- Author had a File in an Envato Bundle
- Sold between 250 000 and 1 000 000 dollars
- Author was Featured
- Item was Featured
- Contributed a Tutorial to a Tuts+ Site
- Exclusive Author
- Has been a member for 3-4 years
- India
I’m not sure if this will work. But you can give a try:
echo do_shortcode(stripslashes($data['custom_section_content']));
^^Hmm, not looked into that but the above could work…
To me it just sounds like a issue with Wordpress not parsing the shortcodes when called from a function.
I would look into exactly how Wordpress parse the shortcodes from a post or page… A solution might lie there. I’m willing to bet this has nothing to do with the server configuration on this particular client and more to do with how Wordpress parses and converts shortcodes when called directly from that function.
Or there is something wrong with your custom function… or the parameters you are sending it is garbage…
@all: thanks for your answers.
@SaurabhSharma: I did try that last night because he has the “magic quotes” enabled. No luck though.
@iamthwee: I thought about that but I don’t think this is the problem. I’ve tried with the most simple shortcode ever that I’m sure 100% is working for anyone. Still, no luck. And it’s the first user that reports this. I had over 1200 sales and no one ever complained about this.
Cheers!
- Sold between 250 000 and 1 000 000 dollars
- Community Moderator
- Author was Featured
- Item was Featured
- Bought between 50 and 99 items
- Referred between 1000 and 1999 users
- Has been a member for 3-4 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
Maybe he’s running a plugin that’s filtering out the shortcodes. I highly doubt it’s an issue with WordPress Core. Most likely something else in their installation is breaking things.
To be sure, echo the content of $data[‘custom_section_content’] just to be sure it is what you expect it to be.
