Sharing Dynamic Sidebars across Multisite Blogs

Unfortunately, the switch_to_blog() method isn’t going to work for this purpose. switch_to_blog() is really only a partial switch – it makes some modifications to $wpdb that help with database queries. But it’s not a complete switch in the way you might imagine. In particular, dynamic_sidebar() depends on global called $wp_registered_sidebars. This global is populated by … Read more

$wpdb->base_prefix not get parent site prefix in multisite

$wpdb->base_prefix gets the original prefix (ie, the ‘root’ site in a Multisite installation). It was added in Version 3.0.0, right when Multisite became a part of WordPress core. $wpdb->prefix will get the prefix for the current site in a Multisite installation. Per the documentation for the wpdb class: $prefix The assigned WordPress table prefix for … Read more

Which asset URLs are acceptable in a “vanilla” MU install?

Short Answer example.com/bob/files/picture.jpg is the preferred, canonical URL for images in a WordPress Multisite installation. The two URLs with blogs.dir in the URL are essentially identical, and both leverage the filesystem structure. The path with ‘bob’ exists because you did a sub-directory install, not a subdomain install. Other paths would exist based on your other … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)