WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Same sidebar/widgets across all sites (11 posts)

  1. myladeybugg
    Member
    Posted 1 year ago #

    I am looking to have the same sidebar/widgets on all the sites on my network. I know there are plugins that will "clone" a site, but not sure if there is a better way of doing this? Wondering if it's somehow possible to override the sidebar call so that it forces it to pull widgets from one specific site on the network?

  2. Not really. You'd want to expand on the work here: http://wpmututorials.com/plugins/networkwide-menu/

    But really, Multisite's for separate sites. If you need then to be 100% the same you're almost better off hard coding it into your theme.

  3. myladeybugg
    Member
    Posted 1 year ago #

    I attempted hardcoding the sidebar following this: http://codex.wordpress.org/Customizing_Your_Sidebar

    The problem was that it was just taking the main blogs archives, categories, etc. and displaying them across all of the blogs. I am looking to have it display the archives and categories specific to that blog.

    Here is what I had:

    <!--Archives-->
    	<li id="archives"><?php _e('Archives:'); ?>
         <ul>
    <?php wp_get_archives('type=monthly'); ?>
         </ul>
    
    	 <!--Recent Posts-->
    	 <h2>Recent Posts</h2>
    <ul>
    <?php
        $recent_posts = wp_get_recent_posts();
        foreach( $recent_posts as $recent ){
            echo '<li><a href="' . get_permalink($recent["ID"]) . '" title="Look '.$recent["post_title"].'" >' .   $recent["post_title"].'</a> </li> ';
        }
    ?>
    </ul>
    
    	<!--Categories-->
    	<li id="categories"><?php _e('Categories:'); ?>
    	<ul>
    <?php wp_list_cats(); ?>
    	</ul>
     </li>

    I could be completely off on this. I am not good with PHP at all, so bear with me.

  4. Wait so you want the sidebars to be the same, but the content to be per site? So every site shows their recent posts?

  5. myladeybugg
    Member
    Posted 1 year ago #

    Yes. So I would like the categories ( I guess you would call them ) to be the same i.e archives, posts, etc. But display the content specific to the blog.

    So when on user1 blog is shows user1 posts, archevies, categories and when on user2 blog it shows user2 posts, archives, and categories.

  6. *ponder* Hard coding the calls into the theme would work.

    <!--Categories-->
    	<li id="categories"><?php _e('Categories:'); ?>
    	<ul>
    <?php wp_list_cats(); ?>
    	</ul>

    I mean, that really should work if it's in the theme's sidebar.php or whatver.

  7. myladeybugg
    Member
    Posted 1 year ago #

    I'll keep plugging away at it.

    Thanks for the help as always!

  8. myladeybugg
    Member
    Posted 1 year ago #

    Got it working.

  9. postmarkj
    Member
    Posted 10 months ago #

    myladeybugg - what was the solution? I want the same widgets defaulting across all new sites so that new users (very inexperienced users at that) would see what I choose to be the most helpful.

    Thanks,
    Mark
    IDDeaArts, a portal for artists with intellectual and developmental disabilities.

  10. myladeybugg
    Member
    Posted 10 months ago #

    Hmm, Let me try to remember what I ended up doing.
    .... I am not currently running this anymore, but here is what I found in my sidebar.php. Hopefully it helps you.

    <!--Recent Posts-->
    	 <h2 class="cus_header"><span><?php _e('Recent Posts'); ?></span></h2>
    		<ul style="padding-bottom:15px; float: left !important;">
    
    		<?php $recent = new WP_Query("showposts=10"); while($recent->have_posts()) : $recent->the_post();?>
    			<li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
    			</li>
    		<?php endwhile; ?>
    		</ul>
    
    	<!--Categories-->
    	<h2 class="cus_header"><span><?php _e('Categories'); ?></span></h2>
    		<ul style="padding-bottom:15px; float: left !important;">
    		<?php wp_list_cats(); ?>
    		</ul>
    
    	<!--Archives-->
    	<h2 class="cus_header"><span><?php _e('Archives'); ?></span></h2>
    		<ul style="padding-bottom:15px; float: left !important;">
    			<?php wp_get_archives('type=monthly'); ?>
    		</ul>
  11. postmarkj
    Member
    Posted 10 months ago #

    Thanks very much!

Topic Closed

This topic has been closed to new replies.

About this Topic