How to combine multiple sites to WordPress MU

Manually I’m pretty sure I’ve seen this topic covered by Ipstenu and/or Andrea in Multisite support forum. But this demands a in-depth search in the un-friendly search functionality of WordPress.org. And if my memory serves me well, I think the solution is to invert the method used to extract a site from Multisite. This method … Read more

How to prevent first post and first comment on WP MU?

I usually just run a function on wpmu_new_blog – best to put in mu-plugins function wpse_wpmu_remove_default_content($blog_id, $user_id, $domain, $path, $site_id, $meta) { if ( !current_user_can(‘manage_network’) ) return; switch_to_blog($blog_id); // Remove the default post & page wp_delete_post(1, true); wp_delete_post(2, true); // Remove the first comment wp_delete_comment( 1, true ); restore_current_blog(); } add_action( ‘wpmu_new_blog’, ‘wpse_wpmu_remove_default_content’ );

Multisite use language code as subdirectory

Here’s a proper multisite solution: Install WordPress directly on the root of your domain mysite.de. After that, setup a multisite and chose the subdomain option (Yes, subdomain! It’s far more flexible and you can use it with subdirectories as well). WordPress will ask you to update wp-config.php and .htaccess. To the wp-config.php add the following … Read more

Multisite without .htaccess

e.g. wpinstance.com/wp-admin is not rewritten into wp-admin/ with a trailing slash, but into ugly long link: https://wpinstance.com/wp-login.php?redirect_to=https%3A%2F%2Fwpinstance.com%2Fwp-admin%2F&reauth=1 As is already mentioned in comments, this is intentional. There is no “pretty” URL for this. And neither does there need to be – this should not be indexed or linked to. do I need .htaccess? No, you … Read more

Two WordPress sites sharing the same database

You won’t be able to use the same database. If you do your going to have all sorts of problems. With the biggest problem being you cannot have two different values for the site URL. I would suggest a managed hosting solution such as Pantheon. This will provide you with a development, test, and live … Read more

the blog owner multisite

I use this workaround to get the ID of the owner of the current blog: $thisblog = $current_blog->blog_id; $mail = get_blog_option($thisblog, ‘admin_email’); $user_from_email = get_user_by(’email’, $mail); $user_id = $user_from_email->ID;

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?

It turns out I was barking up the wrong (or at least a slightly different) tree by using wp_insert_attachment. media_sideload_image managed to pull attachments from other blogs on the same multisite install, copy them to the aggregating blog’s uploads directory, and generate thumbnails, while wp_insert_attachment was doing what it was supposed to, which just happened … Read more

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