Broken image multisite

After reading several topics about this issue I’ve found this: Issues with old WPMU installs If you installed WordPress MU in subfolder/subdirectory (not in root folder on your server >via ftp) and you have problem with image library, where thumbnails and images do not show, >you may need to manually add in rewrite rules for … Read more

How to save values of a custom input field on the Network > Site Info screen

The problem was a redirect in site-info.php. After that the $_POST variable was empty in the code inserting in the admin_footer. I just need to use a further hook ‘admin_init’ and save the value here. add_action(‘admin_init’, ‘pg_save_custom_site_options’); function pg_save_custom_site_options(){ global $pagenow; if( ‘site-info.php’ == $pagenow && isset($_REQUEST[‘action’]) && ‘update-site’ == $_REQUEST[‘action’] ) { // Use … Read more

Posts wont expire

create for these posts a customfield with the name expires and the value is the date for disabling the post. Use the following code in the Loop of your theme. //Loop-Start if (have_posts()) : while (have_posts()) : the_post(); $exTime = get_post_custom_values(‘expires’); if (is_array($exTime)) { $exString= implode($exTime); $seconds = strtotime($exString) – time(); } else { $secondes … Read more

Auto create pages on WordPress multi site register

Not sure about multisite, however it usually works similarly to single site, so the following info may be useful: There is a pluggable function (ie you write your own which will run instead of wp’s function) “wp_install_defaults” Put your function in a ‘dropin’ plugin for install.php and wp will use your function to create defaults … Read more

Adding categories to all blogs at once

You could write a script for that, here is something I wrote in Perl lately: first the sql statements to check if the term already exist and if not insert it: the prepared statements: my $wts = $dbh->prepare( “SELECT term_id FROM $tb_wp_terms WHERE name = ?”) or die “Couldn’t prepare statement: ” . dbh->errstr; my … Read more

Multisite configuration fails with css/js files

The problem was in the .htaccess file the installation script generated. Specificaly, those two lines: RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) home/itaymoav/dev/lmspages/$2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ home/itaymoav/dev/lmspages/$2 [L] The path in there is the actual path to the files. While it had to be the relative path from root dir of the worpress installation. Or, to put it simply: RewriteRule … Read more

Domain redirect in WordPress multisite

What I want to do is redirect www.domain2.com to www.domain1.com/domain2. Then you don’t want to do it via htaccess. You need to use the WordPress MU Domain Mapping plugin. Map any blog/site on a WordPressMU or WordPress 3.X network to an external domain. Also see: WordPress 3.0: Multisite Domain Mapping Tutorial The other day, Klint … Read more