I want to get a sidebar and save it in a Variable,
This is impossible with the get_sidebar function since it simply prints out
the sidebar, is there another function that I can use?
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
|
|||||
|
|
You probably need to use output buffering, if I understand your question correctly. Try something like this:
That will put the output of the sidebar into the variable $sidebar, which you can then process and return from your filter on the page content. |
||||
|
|
The The function I think you're after is |
|||
|
|