Changed singlesite to multisite, but new site shows Maintenance
Found it!!! /etc/apache2/sites-available/example.com.conf needs this line: ServerAlias *.example.com (The star was missing! – Merry Xmas)
Found it!!! /etc/apache2/sites-available/example.com.conf needs this line: ServerAlias *.example.com (The star was missing! – Merry Xmas)
First of all include wp-load.php from WP root installation to those PHP files which you want to display and once you have included to your PHP files then you can use WP functions. You can use is_user_logged_in() function to check if user is logged in or not. // Your PHP file that can be viewed … Read more
Thanks to helpful prodding from TheDeadMedic, I see my problem is caused by my own application environment, which I failed to provide in the question because I didn’t think it was relevant. Sorry about that! I usually do briefly describe the environment when posting a question, but it has never been relevant before, so I … Read more
I finally got this sorted. During setup using the installer for cpanel, I had to choose the option to install on my domain WITHOUT www. I was just leaving the default setting which used www and it was causing some issues.
After posting the question, I did a ton of googles, and eventually built a plugin that displays all media for all subsites in a multisite installation. If the user is SuperAdmin, each picture is linked to it’s editing page. The plugin is called ‘Multiside Media Display’, and available via the usual Add Plugins page in … Read more
switch_to_blog($blog_id); still writing to main blog
Thanks to help from @Milo, I was able to figure it out. It had to do with the ‘theme_location’ => ‘main_nav_primary’ line in the wp_nav_menu function call in the header. In functions.php, the primary menu was just registered as primary so I had to change the function call to ‘theme_location’ => ‘primary’. I find it … Read more
Your include path is incorrect. You have: require_once( dirname(__FILE__) . ‘../../../../global_functions.php’); When it should be: require_once( dirname(__FILE__) . ‘../../../../functions/global_functions.php’); The other alternative would be to change your setup from individual standalone installations of WordPress to WordPress Multi-site. You would then have a couple of options: Option #1 being a Must-Use Plugin. Option #2 being a … Read more
Here is a solution I found- // even before any taxonmy/terms are initialized, we reset the tables add_action( ‘init’, ‘the_dramatist_change_tax_terms_table’, 0 ); // on blog switching, we need to reset it again, so it does not use current blog’s tax/terms only // it works both on switch/restore blog add_action( ‘switch_blog’, ‘the_dramatist_change_tax_terms_table’, 0 ); function the_dramatist_change_tax_terms_table(){ … Read more
How about an if statement? <?php $blogs = get_last_updated(‘ ‘, 0, 3); foreach ($blogs AS $blog) {; switch_to_blog($blog[“blog_id”]); $lastposts = get_posts(‘numberposts=1&orderby=date’); foreach($lastposts as $post) : setup_postdata($post); ?> <?php if $blog[“blog_id”] != 1 { ?> // Run the Output if the ID is not X <div class=”col-sm-4 blog-newest”> <!– blog name –> <h3><?php echo $blog_title = … Read more