Really simple way to add sitewide URL in a Multisite installation. This assumes that the themes you have uploaded and activated sitewide in your installation contained the required wp_head() and wp_footer() hooks in the appropriate locations in each theme.

<?php
/*
Plugin Name: Sitewide Footer Links to Main Site
Plugin URI: http://buddypress.org/
Description: Simple plugin to add a link to main site at the bottom of all pages sitewide
Version: 1.0
Author: Mercime
License: GPL2
*/
?>
<?php 
	function mme_add_sitewide_link_in_wpfooter() {
?>

	<div class="mme-sitewide-link">
		<h3><a href="http://example.com/">Name of Site</a></h3>
	</div>

<?php }

	function mme_add_styles_in_wphead() {
?>

	<style type="text/css">

	div.mme-sitewide-link {
		background-color: #000;
		margin: 20px auto;
		padding: 30px;
		text-align: center;
		max-width: 960px;
		width: 100%;
	}

	div.mme-sitewide-link h3 a {
		color: #fff;
		font-size: 18px;
	}

	</style>

<?php }

add_action("wp_footer", "mme_add_sitewide_link_in_wpfooter");
add_action("wp_head", "mme_add_styles_in_wphead");

?>

1. Create a new folder in server wp-content/plugins/ folder named mu-plugins
== > wp-content/plugins/mu-plugins

2. Create a new file named mme-sitewide-footer-link.php

3. Copy the code posted above, paste into mme-sitewide-footer-link.php and make sure that there’s no space at the top of or beside the first <?php

4. Change the link and name of site to your own site’s link and name in this line

<h3><a href="http://example.com/">Name of Site</a></h3></code> 

5. The style I made for the container of the link is black #000 and the text color is white #fff. Adjust and change to taste.

6. Save mme-sitewide-footer-link.php and upload to server wp-content/plugins/mu-plugins/ folder

About these ads