do_shortcode

tips-and-tricks

#1

Hi, I use “echo do_shortcode” at copyrightsection at end of my theme but now I reallized that thay not work correctly. if you have any suggestion please guide me

http://themes.persitheme.com/godofblue/

Thanks :slight_smile:


#2

Sorry I cannot load your site. What doesn’t work? Give a screenshot of what it looks like and what it should look like.


#3

thank you for your response

now

must be

this is my code

thanks again


#4

Does this section load via ajax by any chance? Because do_shortcode has issues rendering shortcodes in ajax loaded content.


#5

Hi, thanks for reply but this load without ajax


#6

Offtopic: Might want to check this out where Konstantin discourages the use of do_shortcode() https://kovshenin.com/2013/dont-do_shortcode/


#7

Yep that stripcslashes doesn’t look right. Shouldn’t that be done on saving into the database?

Not sure why that isn’t working. You can try echo do_shortcode("[social … whatever [/social]"); and see if that works. If that works then you know it’s a problem with whatever text is stored in the database.