get_sites() for sites registered before given date

Here, this should permanently delete all sites older than 30 days (except the one with ID 1). I was not able to make it work with date_query. If you need to call get_sites() for these sites for some other reason, just instead of deleting them, add their IDs in an array, and then call get_sites() … Read more

How to get blog id from permalink?

the plugin “WDS Multisite Aggregate” store the blog identifier in a meta of the cloned post. then in the template file wich display the cloned posts, you can retrieve the home url of the original website with that : $blogid = $GLOBALS[“post”]->blogid; $blog_details = get_blog_details($blogid); // the home URL is in $blog_details->home I hope this … Read more

Changing URL in multisite

Probably this due to the siteurl setting in db. But for multisite, how did you configure for mult UPDATE wp_options SET option_value=”YOUR_SITE_URL” WHERE option_name=”siteurl”

I’m trying to create security question field for my login page

There is no login_post action that I know of – use the authenticate filter instead, inside wp_authenticate(), called by wp_signon(): function wpse_185339_check_user_answer( $user ) { if ( $_SERVER[‘REQUEST_METHOD’] === ‘POST’ ) { if ( empty( $_POST[ ‘user_proof’ ] ) ) { $user = new WP_Error( ‘proofempty’, ‘<strong>ERROR</strong>: You did not answer the proof-of-humanship question.’ ); … Read more

How do I set a default theme in multisite network

Have you tried enabling the theme from network admin? Visit /wp-admin/network/themes.php and “network enable” the themes you would like to allow access to. You can set a default theme for new / existing sites on your network in wp-config.php Put this in your config file and change the theme name as desired. define(‘WP_DEFAULT_THEME’, ‘classic’); Network_Admin_Themes_Screen#Default_Theme

WordPress 3.8.1 Multisite blog slug problem

I fixed this in the following way. Go to the “Network admin”. Then Sites → Edit → Settings → Permalink Structure. Remove blog from it. Then I removed blog from two lines in table which obtained as a result of the query: SELECT * FROM wp_options WHERE option_name = “permalink_structure” OR option_name = “rewrite_rules” Useful … Read more