3007 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 200+ members
  • Has sold $250,000+ on Envato Market
  • Had an item featured in an Envato Bundle
+7 more
duotive says
atinder said
the difference between the two is same as

echo and return in PHP .

hope this makes sense :)

I have to disagree. If you use echo instead of return in the shortcode api, the content returned by the shortcode will be placed at the begining on the page/post, regardless of where you place it in your text.

236 posts
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
GradaStudio says
duotive said
atinder said
the difference between the two is same as

echo and return in PHP .

hope this makes sense :)
I have to disagree. If you use echo instead of return in the shortcode api, the content returned by the shortcode will be placed at the begining on the page/post, regardless of where you place it in your text.

agree with you. thats why i needed this function

in shortcode if i use dynamic_sidebar(‘sidebar’) it echos at the top of page.can’t return contents.

but if when i used the function given above i can return the contents in shortcode :)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by