The MU forums have moved to

"Adding Blocks" MU Plugin Help (7 posts)

  1. r-a-y
    Posted 14 years ago #

    This message is for Hiranthi, who created the "Adding Blocks" MU plugin:

    I've created a "block" and I'm now wondering how I can output the block in a template.

    If anyone knows how this plugin works, please let me know.


    I'm trying to use this as a stop-gap because I can't get switch_to_blog() to work nicely with register_sidebar().

  2. wpmuguru
    Posted 14 years ago #

    Try putting

    <?php addingblocks_html(); ?>

    where you want the block output in the theme.

  3. r-a-y
    Posted 14 years ago #

    Hi Ron,

    I tried that already, but couldn't get that to work.

    The weird thing about that function is there are no parameters to pass the block ID. And also the function is already hooked to wp_footer. So I should be seeing something displayed, but I don't see any output...

  4. illutic
    Posted 14 years ago #

    I'm sorry I missed this thread.
    This isn't possible yet, will look into this though.

    - Hiranthi

  5. kilo1337
    Posted 14 years ago #

    Hi, great plugin. I have one problem though.

    by using the <?php addingblocks_html(); ?> code mentioned above I was able to display my block.

    BUT! I cannot display it if i do not check enable on mainsite, even though the block is enabled.

    if I leave block enabled and enable on mainsite also, I get 2 occurrences of the block.

    any solution to this?

  6. kilo1337
    Posted 14 years ago #

    ah ha! i figured it out.


    add_action('wp_footer', 'addingblocks_html');


    #add_action('wp_footer', 'addingblocks_html');

    and now i can use the <?php addingblocks_html(); ?> to place it wherever


  7. illutic
    Posted 14 years ago #

    Do remember that it'll add all blocks that would have been added to the footer to that place. So if you have several blocks that would have been displayed on one page they will all be displayed on that specific place you've inserted the addingblocks_html().

    I am thinking of adding manual insertion of blocks (into templates) but I must say that the initial idea of this plugin was something completely different. Because then you'd have to manually edit templates.
    Perhaps even widget support (for blocks you want your users to have the last word on adding it to their blog or not). But that won't happen anytime soon.

About this Topic