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

hi guys is there any way to get the dynamic sidebar instead of directly echoing it.

i want something like get_dynamic_sidebar(‘sidebar’)

1141 posts
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
KarmaThemes says

What do you want to do with it?!

1605 posts Building the Web.
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Exclusive Author
  • Author had a File in an Envato Bundle
  • Most Wanted Bounty Winner
  • Bought between 50 and 99 items
  • Has been a member for 4-5 years
+2 more
ZoomIt says
if(!function_exists('get_dynamic_sidebar'){
function get_dynamic_sidebar($index = 1)
{
$sidebar_contents = "";
ob_start();
dynamic_sidebar($index);
$sidebar_contents = ob_get_clean();
return $sidebar_contents;
}
}
438 posts
  • Exclusive Author
  • Has been a member for 3-4 years
  • United States
christopherjon says

There are a lot of way to do it. Just depends on what you are trying to accomplish.

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
ZoomIt said
if(!function_exists('get_dynamic_sidebar'){
function get_dynamic_sidebar($index = 1)
{
$sidebar_contents = "";
ob_start();
dynamic_sidebar($index);
$sidebar_contents = ob_get_clean();
return $sidebar_contents;
}
}

thanks a lot man it works :)

1141 posts
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
KarmaThemes says

May somebody finally tell me what this does? :D

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

@karmathemes

when we use dynamic_sidebar(‘sidebar’) function it simply display the sidebar. however i wanted to rerturn the content of sidebar instead of displaying it so zoomit has given the perfect solution for that.

1141 posts
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
KarmaThemes says

Hm I’m not sure if I understand the difference but thanks!

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

the difference between the two is same as

echo and return in PHP .

hope this makes sense :)

1141 posts
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
KarmaThemes says

Ah! Thanks!

by
by
by
by
by
by