why when I try to insert an image attachment along with a post does wp_get_attachment_url give me a very wrong file path?

I am using a new blog on WPMS (3.0.1, updating is not an option) to aggregate posts (and their featured image) from a few blogs on the same install, and I have to do it programmatically rather than through a pre-made plugin due to firewall restrictions. I’ve tried several ways of doing it, and feel … Read more

Switch_to_blog() outside wordpress

how can I load switch_to_blog() function outside wordpress? $blog_id = ‘7’; require_once( $_SERVER[‘DOCUMENT_ROOT’] . ‘/wp-load.php’ ); switch_to_blog($blog_id); echo get_option(‘blogname’); restore_current_blog(); echo ‘You switched back.’; I get error: Fatal error: Call to a member function set_prefix() on a non-object in /home/public_html/wp-includes/ms-settings.php on line 126 Any ideas ? UPDATE It can be loaded but without any function … Read more

latest 5 posts using switch_to_blog loop

im sure i must be doing something wrong and would really appreciate a little help. I am trying to loop through all of my Sub Dir “Multisite” blogs using switch_to_blog, below: global $wpdb, $blog_id, $post; $blogs = $wpdb->get_results( $wpdb->prepare( “SELECT * FROM wp_blogs ORDER BY blog_id” ) ); foreach ($blogs as $blog){ switch_to_blog($blog->blog_id); $globalquery = … Read more

switch_to_blog() performance considerations & alternatives

I’m currently in the conceptual phase for a multisite network. The rough idea is: There are multiple networked sites and all publish posts for their own. The network admin is able to establish “content links” between each of the blogs. A “content link” means, that the admin is able to configure the sharing of posts … Read more

switch_to_blog(): Load textdomain

I am using the WordPress multisite feature with Multilingual Press Pro to create a multilingual site with linked posts. In a network activated plugin the custom post types are registered. For translating the slug I use l10n: ‘rewrite’ => array( ‘slug’ => __( ‘products’, ‘text-domain’ ) . ‘/%product-category%’, ‘with_front’ => false ) This works fine. … Read more

Sharing Dynamic Sidebars across Multisite Blogs

I’m trying to find away to retrive a dynamic sidebar from one blog and print it on another blog in the same install of WordPress Multisite. I have tried switch_to_blog($blog_id); dynamic_sidebar($sidebar_name); restore_current_blog(); But nothing is returned. I also tired to retrive the sidebar through get_blog_option($blog_id, ‘sidebar_widgets’) but I was only able to retrive an array … Read more