WordPress.org

Ready to get started?Download WordPress

Forums

Add a global sidebar with widgets? (8 posts)

  1. drummergirl
    Member
    Posted 2 years ago #

    Is there a way to create a widgeted global sidebar that will show up on all child sites?

    There is only one child theme on my site and I have it set up so that a global sidebar appears and I can add html to it, but if I try to add in widget functions, they don't display.

    Is it possible to make a global sidebar with widgets or will it all have to be hard-coded?

  2. Hard coded would actually be the best way around it, as cross-site traffic can get expensive (CPU wise)

  3. drummergirl
    Member
    Posted 2 years ago #

    What about pulling in something like the most recent posts from across the site? Is that doable?

  4. There's a plugin for that - Diamond Multisite Widgets. It uses caching to make magic happen with less drama on the CPU :)

  5. drummergirl
    Member
    Posted 2 years ago #

    I tried that but it breaks my theme. Here is my sidebar code:

    <div id="sidebar-alt" class="sidebar widget-area">
    	<div id="text-4" class="widget widget_text">
    		<div class="widget-wrap">
    			<div class="textwidget">
    				<img src="/images/advertise.jpg" alt="Advertise Here" />
    				<img src="/images/advertise.jpg" alt="Advertise Here" />
    			</div>
    		</div>
    	</div>
    
    	<?php DiamondRP(); ?>
    
    </div>

    If I remove the DiamondRP code, the theme renders fine. When I put it back in, I lose my buddypress menu bar and my footer. Any suggestions?

  6. Can't you echo the shortcode in your template?

    <?php echo do_shortcode('[shortcode option1="value1" option2="value2"]'); ?>

  7. drummergirl
    Member
    Posted 2 years ago #

    It literally just puts [shortcode option1="value1" option2="value2"] on the screen. Just echoes the text.

  8. drummergirl
    Member
    Posted 2 years ago #

    Ok - duh - I didn't even read it. If I use the PROPER shortcode for the widget I get the right output. :D

    Now my issue is that the custom widget I need to display there doesn't have shortcode. Guess I will have build that into the plugin in order for it to work in my global sidebar.

Topic Closed

This topic has been closed to new replies.

About this Topic