Tag Info

New answers tagged

1

Use switch_theme as already indicated in another answer, but hook it to wpmu_new_blog This function runs when a user self-registers a new site as well as when a super admin creates a new site. hook to 'wpmu_new_blog' for events that should affect all new sites. https://codex.wordpress.org/function_reference/wpmu_create_blog If not the code will ...


0

You can use the switch_theme function <?php switch_theme( $stylesheet ) ?> $stylesheet is the Stylesheet name.


0

Yes, multisite is not what you need here. I would try to map all subdomains on the same wordpress install, and then customize the template via the current URL. In the wp-config.php you then use the current URL as base url: define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']); define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']); You can also do ...


1

In MySQL ALTER TABLE wp_blogs AUTO_INCREMENT = 10000; Than create the new site and switch back the auto_increment ALTER TABLE wp_blogs AUTO_INCREMENT = 3;


0

I will answer to my best ability point by point. Yes, wp multisite would be ideal for this and it will all be in one database. Not easy to do without a plugin, but yes there are plugins available for translations. However issues might arise, especially with regards to the customer's expectations. a) This can be a problem, as the translation plugins ...


0

I almost thought this was a duplicate to Network-Wide Plugin Settings Management , but I see you also want shared content. Basically, this is tough and situation and plugin dependent. I'm a fan of WPMUDev's premium New Blog Template for copying content and settings upon blog creation, but it doesn't help with subsequent settings and content changes. ...


0

This isn't a complete answer, but maybe it will get you started. I think I would hook into something like this... add_action('switch_theme', 'mytheme_setup_options'); function mytheme_setup_options () { // todo: delete old sample data // todo: import new sample data // todo: figure it if this fires upon 1st activation, or just upon switches. } You ...


0

Get post thumbnail url with multisite function multisite_thumb_url($pid, $bid){ if(isset($pid) && $pid>0){ if(isset($bid) && $bid>0){ global $wpdb; $curr_blog_id=get_current_blog_id(); $wpdb->set_blog_id( $bid ); $post_thumbnail_id = $wpdb->get_var( "SELECT meta_value FROM {$wpdb->postmeta} ...


0

SOLVED: This is issue was solved by correctly flushing rewrite rules: global $wp_rewrite; $wp_rewrite->init(); //important... $wp_rewrite->flush_rules();


1

There's two parts to this, the javascript ajax call needs specific variables included: $.ajax({ type: "GET", url: SSL_Ajax.ajaxurl, cache: false, dataType: "jsonp", crossDomain: true, data: { action : 'ajaxSSL', ajaxSSLNonce : ...


0

I use the premium plugin New Blogs Template from WPMUDev.org. I've been prepared to supplement it with custom code, but its been working good-enough so far. It will copy menus, settings, and some content. From your description, I think the plugin does everything you need. It is designed to also be used in conjunction with the premium Gravity Forms plugin ...


0

Multisite Enhancements is plugin that apparently does a lot of stuff, including showing which blogs use which plugins. I haven't had a chance to try it myself, but I've had my eye on it. If you wanted your own code, vs. using a plugin, I suppose you could poke around inside the plugin to see how it works for them.


0

the plugin we used for the events (Events Manager Pro) had an extra metadata field for each event which contained the blog id so this problem is solved


-1

you must define path to current site like this : define('PATH_CURRENT_SITE', '/wordpress/');


0

You can change the theme based on the current domain like function select_theme( $current_theme ) { if ( 'domain1.com' === $_SERVER['HTTP_HOST']) { return 'domain1 theme name'; } else { return 'domain2 theme name'; } } add_filter( 'stylesheet', 'select_theme' ); add_filter( 'template', 'select_theme' );


0

I faced the same error. I've both Nginx and Apache installed. Nginx works as a reverse proxy and serves static files. Due to this reason, you have to insert the following code inside server directive: if (!-e $request_filename) { rewrite /wp-admin$ $scheme://$host$uri/ permanent; rewrite ^(/[^/]+)?(/wp-.*) $2 last; ...


0

After an agonising search I found out that somehow the ms_files_rewriting option had been turned on. I've had it off since the install, but in progress of updating something it was set to 1 in db. Setting it back to 0 fixed the issue.


0

This line was missing from my .htaccess file, and I recovered it from a backup. I don't know if WP removed it during an upgrade or some other plugin did it, but replacing it fixed the problem: #uploaded files RewriteRule ^files/(..+) wp-includes/ms-files.php?file=$1 [L] Art Smith


2

SOLUTION: I added $titles = array(); at the top (outside the loop). Then, within the loop, I used array_push( $titles, get_the_title( $ID ) ); to collect the titles. Then I just checked the array for a matching title before displaying, like this: if ( !in_array(get_the_title( $ID ), $titles ) ) ...then do this And it works!


2

The possibilities to set a favicon are different. I think the best way is about a plugin. Also here give it more possibilities. You can use this plugin, that enhance the customizer to set a Favicon. Use this plugin, enhance more as only the favicon Custom plugin, see the code hints below. The follow example set a favicon from the theme path of each blog. ...


0

WordPress has no macros like that but it can be done. If the plugin is already installed, you can Network Activate it so it will be available on any blog in the network. As for the page with title, you'll need to create or source a plugin to do that as it will need to be created after the site is created. A quick and untested approach: add_action( ...


2

No way to do that in a "word press" way... function multisite_profession_select(){ switch_to_blog(1); $taxonomies = array('rsitecat'); $check_later = array(); global $wp_taxonomies; foreach($taxonomies as $taxonomy){ if (isset($wp_taxonomies[$taxonomy])){ $check_later[$taxonomy] = false; } else { ...


0

Ok I actually ended up finding an answer by myself :D Check out this blog post: http://halfelf.org/2014/switching-main-blog-multisite/


0

i know its old but i fixed it! i installed WP MU in a subfolder. htaccess: RewriteEngine On RewriteBase /YOUR_SUBFOLDER RewriteRule ^index\.php$ - [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ...


0

I just wanted to modify some of the text so I was able to filter gettext using this code put into mu-plugins/my-functions.php. It will NOT work putting this into a regular plugin, but you can put it into functions.php of your base theme. function rgbook_activate_page_action() { add_filter('ngettext', 'rgbook_activate_page_change_text' ); ...


1

It can be done, I'm actually using it for my private multisite installation. Install WP multisite and set it up in "subdirectory-mode" Install and setup the Domain Mapping plugin by WPMU Create a subdomain and point it to your installation. Add this subdomain via the Domain Mapping plugin. By default your new sub-sites are accessible in a subdirectory ...



Top 50 recent answers are included