I chose this subject to write about for two reasons. One: I'm sure there are folks out there who will find this useful. And Two: I can never remember it myself so by writing about it here, I won't have to remember, I can just refer back to my own blog! Often, when using WordPress multisite as a content management system rather than a blog network, I have the need to use a blog slug in image paths, or when doing DB queries or whatever. There are lots of reasons, but here's how you get it > 1 I find the $GLOBALS variable to be really useful. If you'd like to see all the stuff you can get out of there, just drop this line in your theme somewhere (it's quite long, so best not to do it on a production site)- 1 Enjoy!
I'm working on a new WordPress Mu site and am using Donncha's fantastic Sitewide Tags Plugin to pull all the posts from across my network of blogs onto one master blog for indexing features across my site. One thing I didn't realize however was that (at the moment) it only works on posts published AFTER you start using it. If you're like me you have 100s or 1000s or even more posts already in your network. I stumbled across some code the other day that will iterate through your blogs and pull the existing posts into the new tags blog. So Colas Nahaboo, whoever you are, thanks for this awesome bit of code: 1 The easy thing to do, is using the WPMU Power Tools plug-in, from Brian Freeman, run the above query exactly as it is across all blogs and within a few seconds all of your posts will be pulled in. Easy! Thanks to Andrea and Donncha for tips over the past few days, I always appreciate the help.
Kudos to Dimox for a great non-plugin WordPress function for creating breadcrumbs. For someone like me though, who is implementing a WordPress Mu site using "blogs" as content sections instead of the traditional community of blogs, I'd like to be able to have breadcrumbs that go more like this- Home (root uri) » Blog Home (blog uri) » normal breadcrumbs To accomplish this, I just made a few modifications to Dimox's code and with the power of WordPress, Shazam!, it was done. Here's the chunk of code I added/modified (note, this code goes in your themes' functions.php file): 1 And that's it, now just do everything else as Dimox suggests on his site. Enjoy!