How to get blog_id of an MU site when running a custom function on the parent site
You need to use the global $current_blog instead. $GLOBALS[‘current_blog’]->blog_id will return the correct id.
You need to use the global $current_blog instead. $GLOBALS[‘current_blog’]->blog_id will return the correct id.
The file robots.txt doesn’t exclude all the search engines to crawl your site… Most search engines crawl the hole site without taking the robots.txt file in consideration. I think that the best way is to use meta tags in the theme of the blogs. Use the next meta tags for post and categories template files: … Read more
take a look at this plugin : Multi-Site Site List Shortcode or if you prefer a snippet then: $blog_list = get_blog_list( 0, ‘all’ ); if (count($blog_list) > 1){ echo ‘<ul>’; foreach ($blog_list AS $blog) { echo ‘<li>Blog ‘.$blog[‘blog_id’].’: ‘.$blog[‘domain’].$blog[‘path’].'</li>’; } echo ‘</ul>’ }
You’re probably going to have to write some custom SQL for that. Here’s an example function that would do this. It’s slightly insecure as we can’t use $wpdb->prepare to put the blog_id in (it surrounds anything inserted with quotes). <?php function wpse33779_get_posts_from_blog( $blog_id = 1 ) { // is this is the current blog, just … Read more
I dont think there is anything like page_template=> but you can just specify the template like this: update_post_meta($id, “_wp_page_template”, “new_template.php”); http://codex.wordpress.org/Function_Reference/update_post_meta or using your code above: $wpdb->insert( $wpdb->postmeta, array( ‘post_id’ => 2, ‘meta_key’ => ‘_wp_page_template’, ‘meta_value’ => ‘new_template.php’ ) );
Use any number of CDN plugins http://wordpress.org/extend/plugins/search.php?q=CDN or a cache plugin that also suports a CDN like WP Super Cache http://wordpress.org/extend/plugins/wp-super-cache/
The problem is that the idea of “the user of a specific subdirectory” doesn’t really exist natively in WP. There are sites (“subdirectories”), and there are users, and users can be associated with sites (through Roles and Capabilities), but there is no guarantee of a one-to-one correspondence. If you are running a network where users … Read more
That’s a pretty lengthy question, so I try to be brief and still hit all your points. If nothing else, maybe someone else can improve on what I suggest. Does it do it out of the box? No It does however have the ability to do the things you’ve asked “out of the box”, it’s … Read more
The site not being listed under My sites has happened to me loads. Go to Network Admin > Sites and you should see you site. The username is more than likely, not yours, Simply go into the user editor section add your self as an admin and delete the default user. This should make it … Read more
“blog” is a reserved name within the WordPress system, so you really can’t be using it as you are trying to do. A better solution would be to name the site something else that is a legal wordpress site name, and then use .htaccess to redirect the old links to the new ones.