How to set an option for all sites in my network?

Excuse me if I’m misunderstanding you, but aren’t the functions add_site_option(), update_site_option() and get_site_option() pretty much, they fall back to single site functions, if not used in a multisite environment, only there for the purpose of having network-wide options. Update: Regarding your need to change a single site option for all sites in your network. … Read more

multisite: use a virtual subfolder for subblogs

I had a similar issue with another client, entering something like projects/project1 would error as the / would fail validation. After failing to find an override or filter, instead I found a loophole. If you make projectsproject1, then afterwards edit the site so its url is projects/project1 and save, update the homeurl etc, it works! … Read more

Use wp_nav_menu() to display a Menu from another site in a Network install?

This is what I’ve used recently. It’s very simple but it works well for me. function wp_multisite_nav_menu( $args = array(), $origin_id = 1 ) { global $blog_id; $origin_id = absint( $origin_id ); if ( !is_multisite() || $origin_id == $blog_id ) { wp_nav_menu( $args ); return; } switch_to_blog( $origin_id ); wp_nav_menu( $args ); restore_current_blog(); } I’ve … Read more

WordPress Multisite Multiple child theme

You can copy your canvas-child folder and call it canvas-child-2, or similar. Then open up style.css in canvas-child-2, and edit the Theme Name:. Do this for as many different child themes you need. You will then need to enable the child themes for the sites you wish to use them on. Visit the Sites menu … Read more

How Is Network Activate Different From Activate (by Implementation)?

Network activation will activate a plugin for every site in a network whereas regular activation will only activate a plugin for the site you’re currently on. As far as implementation goes, there is one other important difference: If your plugin is built to do something when it’s activated (via register_activation_hook()), this will fire automatically when … Read more

How to hide or remove unwanted widgets on Multisite installation?

Add this to your functions.php file: function jpb_unregister_widgets(){ unregister_widget(‘WP_Widget_Pages’); unregister_widget(‘WP_Widget_Calendar’); unregister_widget(‘WP_Widget_Archives’); unregister_widget(‘WP_Widget_Links’); unregister_widget(‘WP_Widget_Meta’); unregister_widget(‘WP_Widget_Search’); unregister_widget(‘WP_Widget_Text’); unregister_widget(‘WP_Widget_Categories’); unregister_widget(‘WP_Widget_Recent_Posts’); unregister_widget(‘WP_Widget_Recent_Comments’); unregister_widget(‘WP_Widget_RSS’); unregister_widget(‘WP_Widget_Tag_Cloud’); unregister_widget(‘WP_Nav_Menu_Widget’); } add_action( ‘widgets_init’, ‘jpb_unregister_widgets’ ); This will get rid of all default widgets. If you want to keep a certain widget, remove that line from the function above.

multisite 404 error for subdirectory

I had the axact same problem. My solution: edited/etc/apache2/sites-enabled/000-default.conf. It needs to look like: <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html <Directory /> Options FollowSymLinks AllowOverride all </Directory> <Directory /var/www/> Options FollowSymLinks AllowOverride all Order allow,deny allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> It works!

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