"Switch_to_blog" for all of those global header and sidebar needs…
-
While some people are letting their members do any style, any way on their own personal MU blog pages, I wanted a more uniform appearance, at least at first, for my site.
I’d seen others ask the same or similar questions about creating what would be a “global” header and sidebar functions that could then be used on the member pages. But I’d never saw an easy way to do this until today.
The switch_to_blog function.
I had no idea there was such a thing — mainly ’cause I’m still learning WP — but it’s been a pot of sweet, succulent goodness now that I’ve discovered it and how it works.
I’ve been able to use it to create a consistent header across all of the member blogs. I’m working now on creating the recurring sidebar I wanted by using that and the restore command.
I’m sure there are some limitations, but I’m not attempting anything too fancy with this. So if you are working at trying to get some kind of scripted action controlled from afar for your member pages, check out the
http://codex.wordpress.org/WPMU_Functions/switch_to_blog
and
http://codex.wordpress.org/WPMU_Functions/restore_current_blog
We now return you to your regularly scheduled Forum conversation, already in progress.
You must be logged in to reply to this topic.