• justinbriggs1

    (@justinbriggs1)


    Hey everyone, I just had my multisite client give me an unusual request. They want each subblog’s widgets to be controlled by the main blog, i.e. the sub-blog administrator will have no control over the widgets, and they will exactly reflect the widgets on the main one. Is there a way to do this? Thanks,

    Justin

Viewing 5 replies - 16 through 20 (of 20 total)
  • Speggey

    (@speggey)

    So you’re using a plugin shortcode in a text widget? and that works ?

    top5free

    (@top5free)

    I use duplicate themes on my site. The main blog is the original and the sub domains is an altered copy. I do this so that I can take things from my main blog and code them into my sub domains. Right now I use it effectively for the search box but probably would require additional coding for some thing that changes often.

    Not sure if it’s right for you but I use cets_blog_defaults plug-in. It allows you to set defaults for new blogs including themes and plug-ins

    Speggey

    (@speggey)

    Thanks, I figured it out! had to change some things in the plugin..
    get_option() to get_blog_option() to get the correct url’s.

    However now that I override sidebars_widgets with

    add_filter( 'pre_option_' . 'sidebars_widgets', 'override_sidebars_widgets' );

    I can’t use any widgets on the blogs independently.

    Thought the solution was to use pre_update_option but that didn’t work.

    Is it possible to just add the sidebar_widgets without completely overriding?

    Your original post:

    they will exactly reflect the widgets on the main one.

    There are limits to what you can do with a “switch_to_blog” and “pre_option_” filters. These methods break down when there is more complex dependencies on other options or db queries.

    And now:

    Is it possible to just add the sidebar_widgets without completely overriding?

    It would be simplest to hardcode the advertising widget/functions in each theme’s sidebar outside the dynamic sidebar code: <?php if(function_exists( 'wp_bannerize' )) wp_bannerize(); ?> While also modifying the plugin to only get_blog_options from blog 1 and adding the admin menu to blog 1.

    Hi, yeah I guess that would be the easiest. It doesn’t work though. The function doesn’t exist. I activate the plugin on blog 1, and switch to blog 1 then try to run the function.

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘Sub-blogs use the main blog widgets’ is closed to new replies.