A floating footer in WordPress allows you to promote upcoming posts, ideas and links to information. It also gives you the opportunity to show readers special information you want them to see. Floating footer bars, or “Sticky” footer bars are when the there is bar at the bottom of the visitors browser that moves with them down the website as they scroll. It is always visible.
By using a floating footer you can bring more attention to your featured posts, emails or whatever you wish to highlight. A floating footer is a static bar that does not close, but can be set up to rotate content continually, highlighting important information, posts sites, events, or anything you think could be important to the readers of your blog or page. Floating footers are another feature of WordPress designed to make the life of someone running a blog or page less complicated and give you another degree of control over the content on your page or blog.
There are quite a few different options when choosing a floating footer, and each has different features depending on what your needs are. If you want a footer that is easy, quick and efficient then this is the method for you. To use the floating footer in WordPress begin by creating a div with the CSS property in the fixed position, then use JQuery math code to enable the items added to the footer to be on a rotating modulation.
Creating a Floating Footer
- Open Footer.php file
- Add the codes below; codes should be added right before the closing of the body statements above all the scripts.
- Next step is to add the CSS
Note:
- You can add as many items as you like, but only one per page.
Adding the CSS
- Open Style.CSS file
- Paste in following codes
/*-- WPLearninglab Footer Bar --*/
fixedBar{background: #000; bottom: 0px; color:#fff; font-family: Arial, Helvetica, sans-serif; left:0; padding: 0px 0; position:fixed; font-size:16px; width:100%; z-index:99999; float:left; vertical-align:middle; margin: 0px 0 0; opacity: 0.95; font-weight: bold;}
.boxfloat{text-align:center; width:920px; margin:0 auto}
#tips, #tips li{margin:0; padding:0; list-style:none}
#tips{width:920px; font-size:20px; line-height:120%;}
#tips li{padding: 15px 0; display:none}
#tips li a{color: #fff;}
#tips li a:hover{text-decoration: none;}
- Now have main fixedBar.div
- Sets colour scheme and main styling
- Most important class is position:fixed element
- Set Z-index property, very high
- Youtube embeds can mess up and override your footer
Youtube Embeds
Youtube embeds can mess up the position of the footer, but they can be overrriden. Youtube videos can override other content on your page, especially if you have drop-down boxes, floating bars or light box pop-up. Embedded videos in WordPress has no wmode=transparent value by default, that means videos have higher priority than other elements on your page. By following the instructions below:
function add_video_wmode_transparent($html, $url, $attr) {
if ( strpos( $html, "