How can I get a variable into a sidebar?

$sidebarnum = 4;

dynamic_sidebar('Footer Widget $sidebarnum'); ?>`
  • Any feedback on this post. Did the answer below solve your issue. If yes, please mark it as accepted by clicking on the checkmark next to it. If it did not, feel free to post your own answer and accept it :-) Mar 12, 2015 at 14:45

1 Answer 1


Replace this line

dynamic_sidebar('Footer Widget $sidebarnum');

with this

dynamic_sidebar('Footer Widget ' . $sidebarnum);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.