Skip Navigation

[Resolved] Multisite with toolset

This thread is resolved. Here is a description of the problem and solution.

Problem:

I want to use the view from the main site to the subdomains

Solution:

There isn't such kind of built-in feature, you might consider custom codes, for example:

https://toolset.com/forums/topic/multisite-with-toolset-2/#post-2318145

Relevant Documentation:

This support ticket is created 2 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by garenM 2 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#2316985

Hey there is an option to use the same view in a multisite wordpress. I want to use the view from the main site to the subdomains. Is that possible?

#2317007

Hello,

There isn't such kind of built-in feature, you might consider custom codes, for example, see the solution of below similar thread:
https://toolset.com/forums/topic/loading-a-view-from-one-site-on-another-in-wordpress-multisite/#post-1363179

#2318113

Im getting 404 page on the link that you shared me

#2318145

Sorry, I copy/paste the details here:
Here is an example to display post view of Subsite 3 in another subsite 4
1) Activate Toolset Views plugin in both subsites: Subsite3 and Subsite 4

2) Create a custom shortcodes in Subsite 4:

add_shortcode('switch_to_blog', function($atts, $content){
    $atts = shortcode_atts( array(
        'bid' => '',
    ), $atts);
    $res = '';
    if($atts['bid']){
        switch_to_blog($atts['bid']);
        $res = do_shortcode($content);
        restore_current_blog();
    }
    return $res;
});

3) In Subsite 4, use above custom shortcode, like this:

[switch_to_blog bid="3"]
Here display target subsite3 contents:
[wpv-view name="my-view-slug"]
[/switch_to_blog]

Please replace number 3 with your Subsite3 blog's ID.

More help:
https://developer.wordpress.org/reference/functions/switch_to_blog/
https://codex.wordpress.org/Function_Reference/add_shortcode

#2323713

My issue is resolved now. Thank you!