I'm resubmitting a question I previously asked, but crystalising it down to its 'simplest' form.

In a multisite network, how can one get the blog_id for where a post was originally published from?

It's a simple question that should have a simple answer. We're trying to determine the post's blog_id from outside its originating blog (i.e. from another network blog or the main parent blog), so need some way of supplying an argument such as post_id.

  • I've gone with this as a solution for my current configuration, so for anyone else looking to run timthumb on a parent multisite blog, which has been populated by sitewide tags plugin, here's the code that transforms a relative image path into an absolute one: wordpress.org/support/topic/… I couldn't find any other solutions, so hopefully this will help someone else. Jul 25 '11 at 18:56

Here's a quick way you could do it, though there are quite likely easier/better ways to do it. This is just what I can think of at the moment.

Add a quick function to functions.php that will store the blog ID in the post meta. Then when you need to check where the post came from, just call get_post_meta() and check the value.

  • Thanks @Pippin that's what I eventually went with, I had forgotten that the sitewide tags plugin uses a blogid field in wp-postmeta to store where the original blog was gathered from, so I'm now using that blogid when the absolute URL is built within the timthumb img src call. If only I'd thought of this 4 hours ago... ;) Jul 25 '11 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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