How to get blog id from permalink?

the plugin “WDS Multisite Aggregate” store the blog identifier in a meta of the cloned post.
then in the template file wich display the cloned posts, you can retrieve the home url of the original website with that :

$blogid = $GLOBALS["post"]->blogid;
$blog_details = get_blog_details($blogid);
// the home URL is in $blog_details->home

I hope this is what you need because calculating the original post identifier from the permalink consumes considerably more ressources.

Leave a Comment