fatal Error undefined function switch_to_blog()
fatal Error undefined function switch_to_blog()
fatal Error undefined function switch_to_blog()
Best and simple method to Insert / display articles from another site or multisite is to use wordpress inbuilt RSS Widget. Or else you can try the following plugin https://wordpress.org/plugins/hungryfeed/ https://wordpress.org/plugins/wp-rss-retriever/ Hope this helps!
Use STYLESHEETPATH instead of TEMPLATEPATH. You’ll find the definitions in wp-includes/default-constants.php file. Please have look. So your code block will be like below- //Gets post cat slug and looks for single-[cat slug].php and applies it add_filter(‘single_template’, create_function( ‘$the_template’, ‘foreach( (array) get_the_category() as $cat ) { if ( file_exists(STYLESHEETPATH . “/single-{$cat->slug}.php”) ) return STYLESHEETPATH . “/single-{$cat->slug}.php”; … Read more
As far I researched separate WordPress installation with separate database is not possible using WordPress default trick unless you do some other tricks like “Logging in through API” or any kind of that. So in your situation I think there are two way you can do that. You can use WordPress multisite installation and create … Read more
Update from comments To convert an array of options to site options, you can try something like this: add_action( ‘init’, ‘wpse245699_use_site_options’ ); function wpse245699_use_site_options() { // Uses site options for these options. $required_site_options = array( ‘some_option_name’, ‘another_option_name’, ‘and_another_one’, ); foreach( $required_site_options as $option ) { add_action( ‘update_option_’ . $option, ‘wpse245699_update_site_option’, 10, 3 ); add_filter( ‘pre_option_’ … Read more
The wp_dropdown_category seems to not accept the mera_query parameter codex Maybe you must perform à special query , note that the meta_query must be an array of array. ‘meta_query’=> array( array( ‘key’ => ‘blog_id’, ‘value’ => $blog_id, ‘compare’ => ‘=’ ) ), With the new query you’ll be able to compose your dropdown by looping … Read more
Turns out my domain mapping plugin was to blame. It didn’t like when I linked (ln -s) the sunrise.php file to my wp-content folder, I actually needed to copy (cp) it.
Sounds like you install WordPress on a subdirectory (/multi) and on localhost? Can you log in the main site admin: /multi/wp-admin? The error is to do with “permission to access the requested directory”, it’s probably not to do with WordPress settings/config. Check your WP installation again for potential missing steps (which might cause the permission … Read more
I suppose www.mainsite.com is the main blog and www.mainsite.com/subtitle is a dynamic child blog. You can use MU api for this: add_action(“init”, function(){ global $pagenow; if ( ‘wp-login.php’ !== $pagenow ) return; global $blog_id; $main_blog_ID = 1; // main site ID (use get_current_blog_id() to get ID) if ( (int) $blog_id !== (int) $main_blog_ID ) { … Read more
On default you can’t display all sites of the network on a site of network, like your first screenshot. This is the Dashboard of a site. The site is instance of the network and have no data, dependencies of the network. The network admin have all information about the network, also the list of all … Read more