PhotoDune

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 thanks, didn’t think of that. I just did it and it’s echoing the right thing, still the shortcode won’t execute.

If I echo $data[‘custom_content_section’] I get this for example:

[one_third] TEST TEST [/one_third]

If I echo do_shortcode($data[‘custom_content_section’]) I get the same result. The only plugins are the WP default ones and are both deactivated. Still no luck.

Edit: BTW , is there any other function to run shortcodes out of the query besides do_shortcode? I read something about “apply_filter” but it’s only working for “the_content”.

812 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
iamthwee says

Just throwing ideas… but assuming nothing is wrong with the shortcode like you have an extra space somewhere, I would try to re- upload the shortcodes.php which is in the wp-includes directory.

2844 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

Any chance the shortcode is not being registered, or hasn’t been registered prior to running do_shortcode() ?

Try printing the shortcodes before running the function to see if the shortcode is available:

global $shortcode_tags;
echo '<pre>';
print_r( $shortcode_tags );
echo '</pre>';

That should show you what shortcodes are currently registered.

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

You guys rock. Thanks for all the answers. I’ve managed to fixed it. Still, I don’t know what the problem was although I have a feeling that had something to do with the encoding of the file. I removed the “functions.php” file from the server and added it again from my computer. Now it seems it’s working.

Thanks again. Cheers!

2844 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

sweet! glad you got it sorted out :)

812 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
iamthwee says

Nice… So you just re-uploaded the functions.php instead of the shortcodes.php.

Also this guy here:

http://wordpress.stackexchange.com/questions/32871/how-to-execute-a-shortcode

said he got it working with a fresh install on Wordpress (resetting the server) so maybe it was something to do with encoding like you said?

2 posts
  • Bought between 1 and 9 items
  • Has been a member for 0-1 years
jstudios says

Guys, I’m having a similar issue.

When using ” echo do_shortcode( $options[‘blahblah’]) ” the shortcode outputs fine, except it’s at the beginning of the string.

Instead of getting “Copyright 2012 blah blah blah”.

I get “2012Copyright blah blah blah”.

Any ideas why?

2844 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

Guys, I’m having a similar issue.

When using ” echo do_shortcode( $options[‘blahblah’]) ” the shortcode outputs fine, except it’s at the beginning of the string.

Instead of getting “Copyright 2012 blah blah blah”.

I get “2012Copyright blah blah blah”.

Any ideas why?

Make sure your shortcode is returning rather than echoing its output. Shortcodes should always return a value if you want them to work as expected.

by
by
by
by
by