Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
    
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. –  Steve Davies Jul 25 '11 at 18:56

1 Answer 1

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.

share|improve this answer
    
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... ;) –  Steve Davies Jul 25 '11 at 19:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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