Subsite taking over the parent site
-
I have a multisite installation with 3 subdomains, one for the main site (no ID, but wp-config refers to this as 1), one for blog site (ID 5), and the other for a training site (ID 3).
Since last week, my users have been complaining that the main site is gone when they type cantilin.com (swap a for e). Instead, it’s now replaced by the blog site. And when I try to visit the blog.cantilin.com and training.cantilin.com, it’s all being mapped to the original blog site.
Configuration of wp-config is as follows:
define( 'MULTISITE', true ); define( 'SUBDOMAIN_INSTALL', true ); $base = '/'; define( 'DOMAIN_CURRENT_SITE', 'centilin.com' ); define( 'PATH_CURRENT_SITE', '/' ); define( 'SITE_ID_CURRENT_SITE', 1 ); define( 'BLOG_ID_CURRENT_SITE', 1 );
The only possible reason I can think about is this code snippet that I placed on the main site to grab post content from the blog site.
add_shortcode('blog-posts', 'blog_posts'); function blog_posts($atts) { extract( shortcode_atts( array( 'no' => '', 'id' => '', ), $atts ) ); if($id == '') { $output = 'Invalid Blog ID. Unable to retrieve posts'; return $output; } else { if ( false === ($output = get_transient('msblog_outputs')) ) { switch_to_blog($id); $posts = get_posts("showposts={$no}"); $output = ''; if ($posts) { $output = '<ul class="blog-posts">'; foreach ($posts as $post) { $post->post_title = apply_filters( 'the_title', $post->post_title ); $output .= '<li><a href="' . get_permalink($post->ID). '" title="' . $post->post_title . '">' . $post->post_title . '</a></li>'; } $output .= '</ul>'; set_transient('msblog_outputs', $output); } restore_current_blog(); return $output; } else { return $output; echo $output; } } }
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Subsite taking over the parent site’ is closed to new replies.