Why can't I echo or print?
I’ve created shortcodes that print variable content on the screen. The only way I’ve been able to get the content to show up is to use return (i.e. return ‘Hello World!’;). Neither echo nor print works, even for something simple.
Return works to a point, but I can only use it once within the shortcode, which doesn’t work if I need to add code between. Is there a way I can use echo or print? Am I missing something?
- The topic ‘Why can't I echo or print?’ is closed to new replies.