Including non-wordpress pages within a single multisite domain

You could check for the referring page by using the wp_get_referer() function, which returns the referring page . See https://codex.wordpress.org/Function_Reference/wp_get_referer . But note that the function uses the $_SERVER[‘HTTP_REFERER’] value, which is set by the client, and can be spoofed (or disabled) by the client. So another alternative is to set a global variable that … Read more

Multisite install on a sub-directory

Install it at the root and use a custom theme for the first site. Specifically, you want a subdirectory install, and then for the root sites theme, replace the contents of index.php with that of your static html page. You’ll need a style.css with a comment at the top so WP picks it up as … Read more

Get posts by user role in a Multisite

global $switched; switch_to_blog(2); //switched to your site id based on which site post need. $administrators = get_users( array( ‘role’ => ‘administrator’ ) ); // you can add more role on same query add with “,” separated. $administrators_ids = array(); $original_blog_id = get_current_blog_id(); foreach( $administrators as $admin ): $administrators_ids[] = $admin->ID; $news = new WP_Query( array( … Read more

WordPress multi-domain with multiple sites with multiple languages

Struggled for days to solve a similar problem. Tried Polylang, WPML, all sorts of custom codes. Did some research on domaining and languages. I have started with subdomains. myfancysite.com, then adding de.myfancysite.com, it.myfancysite.com etc. Then I have realized I’m losing some potential. Came up with some conclusion: Spreading multilanguage project on ccTLDs is more expensive … Read more