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”.
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.
- 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
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.
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!
- 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
sweet! glad you got it sorted out 
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-shortcodesaid 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?
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?
- 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
jstudios said
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.
