3007 posts
  • Author had a File in an Envato Bundle
  • Bought between 1 and 9 items
  • Elite Author
  • Europe
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 100 and 199 users
+2 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
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Has been a member for 3-4 years
  • Bought between 1 and 9 items
  • Envato Studio (Microlancer) Beta Tester
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