Tag Info

New answers tagged

4

You can clearly see the way WordPress loads plugins if you inspect the source code of the file wp-settings.php. The function wp_get_active_and_valid_plugins() loads plugins for individual sites in the network and for non-Multi-Site installations, while wp_get_active_network_plugins() loads network activated plugins when Multi-Site is enabled. The former ...


1

If you use switch_to_blog, that use always also restore_current_blog. The restore_current_blog function undos the last call to switch_to_blog, but only by one step, the calls are not nestable, so always call restore_current_blog before calling switch_to_blog again.


0

Look carefully at your .htaccess and apache configuration, Your server is intercepting the request. Unless I'm mistaken, I really don't think this is a WP problem. You might try ServerFault.com and/or your host provider for this one. You also might want to think about how subdomain are mapped to your site. Chances are, if I understand it correctly, you ...


0

I think this is http:// problem.You should add http:// in side your code. Like this. http://blog.mysite.com/article-name/


0

Actually, login_enqueue_scripts action works for any wp-login.php page: login (wp-loing.php) recover password (wp-login.php?action=lostpassword) regstration pages (wp-login.php?action=register) If your registration page is not wp-login.php?action=register, login_enqueue_scripts action is not triggered. In that case you need to use another action hook. ...


0

This works well! "By default, WordPress Multisite uses the main blog for passwort resets. This plugin enables users to stay in their blog during the whole reset process." https://gist.github.com/eteubert/293e07a49f56f300ddbb


0

You are probably confusing resources and disk space. A website and its plugins requires almost no disk space. But all your visitors takes up a lot of resources - CPU, RAM, NETWORK etc. If you are experiencing problems regarding to network traffic, you could move your images to a CDN. Google can help you in this matter. Having trouble with CPU & RAM ...


2

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 ...


1

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;


1

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 { ...



Top 50 recent answers are included