Create batch of sites WordPress MultiSite

If you’ve got command-line access, wp-cli could be the solution you need. You could write up a quick shell script: wp site create –slug=site1 wp user create joe [email protected] –role=administrator –url=example.com/site1 … and so forth. References Installing wp-cli wp site commands wp user commands

Multisite – sort merged get_posts() queries

You can try the new (4.7+) wp_list_sort() utility function that’s a wrapper for WP_List_Util::sort() that uses usort() or uasort(). Example 1: Sort by descending post date $sorted_custom_posts = wp_list_sort( $custom_posts, ‘post_date’, ‘DESC’ ); Example 2: Sort by descending post date and ascending post title $sorted_custom_posts = wp_list_sort( $custom_posts, [ ‘post_date’ => ‘DESC’, ‘post_title’ => ‘ASC’, … Read more

Allow Author on Site A capability to upload files on Site B in Multi Site

Look into switch_to_blog() and its required follow up, restore_current_blog() I left comments in code for basic idea to adapt into your function. It may need tweaking, and can probably be improved. //Site B add_action( ‘init’, ‘site_a_author_upload_site_b’ ); function site_a_author_upload_site_b() { if ( is_user_logged_in() ) { //get a WP_User object of current user $current_user = wp_get_current_user(); … Read more

Image problem – Multisite image upload broken

Just change your .htaccess to this: # BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] # uploaded files RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [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-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L] RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L] RewriteRule … Read more

What is meant by Multisite in WordPress?

WordPress Multisite allows you to use one WordPress code installation to run multiple websites. mywebsite1.com mywebsite2.com mywebsite3.com etc All run from the same code, can share the same plugins, can share the same themes (but use different themes), share the same admin login (but different sites can be limited to different editors), keep all data … Read more

Redirect only posts to New Domain

Thanks everyone for taking time to look and get it solved. After so many trials and try-catch, I managed to achieve the above task by adding these lines to .htaccess RewriteCond %{HTTP_HOST} ^(www\.)?prsblog\.com$ [NC] #RewriteCond %{REQUEST_URI} !\.(jpe?g|png|gif|ico)$ [NC] RewriteCond %{REQUEST_URI} !wp-admin RewriteRule ^(.*)$ https://www.pyarb.com/$1 [L,R=301] This solved my problem for instant.

error code: 521