Multisite Widget/Content

I’m using WordPress multisite and need to display content across all subsites in the sidebar. This is a network of 50+ sites so updating all 50+ sidebars with this content every few days is not practical.

One solution I’ve found is to simply insert the content I want into sidebar.php in the theme editor, though I don’t want my client editing this file, and want them to use TinyMCE editor instead of HTML.

Another idea was to embed an iframe into each subsite and have my client update the page that the iframe was referencing.

And the final idea I had was to create a plugin with the TinyMCE editor that would inject code into the sidebar.php file when saved, though I don’t know if access to editing theme files is available to plugins.

Is there a better solution that I’m not thinking of? I tried a few plugins with no success, did I miss one?

2 Answers
2

Could you use the admin bar at the top instead? To me short messages look better up there.

add_action( 'admin_bar_menu', 'toolbar_link_to_mypage', 999 );

function toolbar_link_to_mypage( $wp_admin_bar ) {
  $args = array(
      'id'    => 'my_admin_bar_text',
      'title' => 'WELCOME TO SYDNEY',
      'meta'  => array( 'class' => 'my-toolbar-page' )
  );
  $wp_admin_bar->add_node( $args );
}   

Likewise though, you can create a short message on the sidebar, but it would have to remain pretty short. The code to do that would be:

add_action( 'admin_menu', 'register_my_custom_menu_page' );

function register_my_custom_menu_page(){
  add_menu_page( 'custom menu title', 'custom menu', 'manage_options', 'custompage', 'my_custom_menu_page', plugins_url( 'myplugin/images/icon.png' ), 6 ); 
}

function my_custom_menu_page(){
  echo "Admin Page Test";   
}

This will add a “custom menu” link to the left (just under Posts). You could name “custom menu” whatever you want, and it has the added bonus of creating a page that you can put more information on if you’d like.

Both of these options, when enabled on the network site, they can’t be disabled per blog. If not network enabled, then it can be enabled and disabled per each blog BY each blog admin.

note: the first code snippet above, I don’t remember where I got it, it’s been chopped around for a while. The second snippet is from WP Codex, http://codex.wordpress.org/Function_Reference/add_menu_page

Leave a Comment