What's the easiest way to add a line of HTML code to all footers on the whole site?
What's the easiest way to add a line of HTML code to all footers on the whole site?
Themes must have a <?php do_action('wp_footer'); ?>
somewhere(usually footer.php).
Make your own footer mu-plugin
<?php
/*
Plugin Name: WPMU Footer
Plugin URI: http://www.domain.org
Description: Adds a footer to every theme, site-wide(Replace YOUR HTML GOES HERE).
Author: You
Version: 1.0
Author URI: http://blog.domain.org
*/
function wpmu_footer($blah)
{
echo 'YOUR HTML GOES HERE';
return $blah;
}
add_action('wp_footer', 'wpmu_footer');
?>
Works great, thank you!
That is great! Thanks for sharing!
Yes, this is a great plugin.
However, is there anyway to code the main theme so that the footer does not show up on the main page?
you could always just comment out the the footer.
or include an if statement something like if blog_id ! = 1 insert footer so it will not be inserted on the main blog.