VideoHive

do_shortcode not working, please help!

98 posts I think about colours
  • Bought between 50 and 99 items
  • Elite Author
  • Exclusive Author
  • Greece
  • Has been a member for 3-4 years
  • Referred between 50 and 99 users
  • Sold between 100 000 and 250 000 dollars
ginaalessia says

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!

812 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
iamthwee says
98 posts I think about colours
  • Bought between 50 and 99 items
  • Elite Author
  • Exclusive Author
  • Greece
  • Has been a member for 3-4 years
  • Referred between 50 and 99 users
  • Sold between 100 000 and 250 000 dollars
ginaalessia says

Thanks for the answer but no, it isnt’t in the excertpt. It’s in the theme options area.

Cheers!

2333 posts
  • Grew a moustache for the Envato Movember competition
  • Community Moderator
  • Elite Author
  • Contributed a Blog Post
  • Won a Competition
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Has been a member for 4-5 years
+8 more
dtbaker moderator says

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.

98 posts I think about colours
  • Bought between 50 and 99 items
  • Elite Author
  • Exclusive Author
  • Greece
  • Has been a member for 3-4 years
  • Referred between 50 and 99 users
  • Sold between 100 000 and 250 000 dollars
ginaalessia says

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!

812 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
iamthwee says
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.

461 posts
  • Author had a File in an Envato Bundle
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 3-4 years
  • India
+1 more
SaurabhSharma says

I’m not sure if this will work. But you can give a try:

echo do_shortcode(stripslashes($data['custom_section_content']));
812 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
iamthwee says

^^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…

98 posts I think about colours
  • Bought between 50 and 99 items
  • Elite Author
  • Exclusive Author
  • Greece
  • Has been a member for 3-4 years
  • Referred between 50 and 99 users
  • Sold between 100 000 and 250 000 dollars
ginaalessia says

@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!

2842 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Community Moderator
  • 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
+4 more
sevenspark moderator says

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.

by
by
by
by
by