New answers tagged

2

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 sub domain option (Yes, subdomain. It's far more flexible but 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 ...


0

I just want to point out that some people may still have an empty site users table—specifically for their root site. If this problem occurs, the way to fix it issue is by doing the following: Go to the table wp_usermeta Find any entries with the meta_key wp_capabilities Change the meta_key from wp_capabilities to wp_1_capabilities I believe "1" is ...


0

Make sure you've set up your rewrite rules in your .htaccess file. The Multisite rules are different from the default WordPress rules. If this is an up-to-date version of WordPress, your .htaccess rewrite rules should look like this: Subdirectory RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # add a trailing slash to /wp-admin RewriteRule ...


0

I actually solved this... here's what you need to do if anyone needs to do something similar: SO, you can't really query a site, but you can query pages on sites... so what I did was make a new page on the site where everything looked good, embed the shortcode, query that page and the content only on the other site. You NEED to have the site switch to that ...


0

You can use the function switch_to_blog() for this $other_id = 1234 // the id of the other blog to save the post to switch_to_blog($other_id); $my_post = array( 'post_title' => $post_title, 'post_content' => $post_content, 'post_status' => 'publish', 'post_author' => $post_author, ); // Insert the post into the database ...


0

Here's what I did: Inserted ob_start() and ob_get_clean(), at strategic places in header.php and footer.php within a child theme derived from my base site's main theme. <some header stuff> ob_start() <header html I want to reuse across network> <?php $html = ob_get_clean(); echo $html; harvest_html($html, 'header'); ?> The function ...


4

Have a look at the Network Admin Settings screen (in my installation, it's at example.com/wp-admin/network/settings.php). Tucked away down near the bottom is this: Menu Settings Enable administration menus [] Plugins Checking that box should allow your users to see the Plugins menu in their sites' back end. (I don't think it'll allow them to ...


0

Try this - it worked for my situation - add_submenu_page( WP_PLUGIN_DIR . '/multisite-super-admin/includes/admin/settings.php', "Plugins", 'Plugins', 'administrator', '/plugins.php', '') ; The URL there is to a plugin I wrote. so you will want to add this to your own plugin. Very straight forward. Learn more about it here - https://codex.wordpress.org/...


0

Here's an example of a solution I configured, which leaves the site in the network, but establishes a domain map from any registered domain, to the network. It makes the network site appear to be a completely independent site, with all the functionality (log-in, etc.) intact. Goal: Map client's registered domain, both www.foosite.com and foosite.com over ...


2

Put the plugin in the wp-content/mu-plugins directory. Each site in your network has its own _options table in the database so as long as you are using built-in WP functions for handling your plugin's options, each site will have its own distinct set of options.


0

I wasn't able to get get_sites working, so here is a solution using wp_get_sites until further documentation is released on the new version. wp_get_sites returns a lot of data about the subsite, including creation and last modified dates. I turned my original $stageurl array into a multidimensional array and added registration date as a value. The ...


1

Yeah, there are a little more steps involved with Multisite. Here's how I did this for a recent project, after much mucking around: Set up virtual hosts rather than subfolders on your WAMP box I'm on XAMPP so this will be a little different for you, but for me I just needed to add the following to c:\xampp\apache\conf\extra\httpd-vhosts.conf: ...


1

Using get_sites() in WP 4.6+ It looks like wp_get_sites() will be deprecated in WP 4.6. The new replacement is: function get_sites( $args = array() ) { $query = new WP_Site_Query(); return $query->query( $args ); } Very similar to get_posts() and WP_Query. It supports various useful parameters and filters. Here's what the inline ...


0

You have two options; either bake into the theme (functions.php) or write a simple plugin that auto-creates the post based on hooking into after new site (blog) creation: https://codex.wordpress.org/Plugin_API/Action_Reference/wpmu_new_blog Use the insert post function to do the creation: https://developer.wordpress.org/reference/functions/wp_insert_post/ ...


0

Have you copied and modified the specified lines from your wp-config.php from old site to the new site? The code should look something like this define( 'MULTISITE', true ); define( 'SUBDOMAIN_INSTALL', true ); $base = '/'; define( 'DOMAIN_CURRENT_SITE', 'yourdomain.com' ); define( 'PATH_CURRENT_SITE', '/' ); define( 'SITE_ID_CURRENT_SITE', 1 ); define( '...


0

Yes, quick and dirty just create a new page template, set it as the home page. Then in your page template copy the signup code from wp-signup.php into the page template


0

So, I've managed to achieve a version of this by setting the "home" value in Network admin > Sites > Edit > Settings to: http://example.com/custom-word/multisite-name In my case the custom word is the unique identifier for the multisite, so I had to swap the positions of the word and the name.



Top 50 recent answers are included