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 :)

by
by
by
by
by
by