Add Eye Catching Popular Posts Sticky Footer Bar on WordPress

Must Read

Four Things You Most Likely Didn’t Know About Guest Post Service

Guest Posting is a great way to raise awareness and build links. However, before starting a guest...

How Does Blogger Outreach Help Your Brand Grow?

Bloggers are eager to promote their content and engage their readers, so building relationships with them are...

How To Get Your Startup Noticed

Being an entrepreneur is always a learning experience. That's because the rules are constantly changing. The change...
Shrinivas
Hi, this is +Shrinivas. I am a freelance web developer and part time blogger having skills in WordPress, HTML/CSS, jQuery, PHP and CodeIgniter.

In my previous post I discussed on how to add attention grabbing notification bar to your WordPress blog, I hope you have given it a try and liked it. In this article let me share a code to show top 5 popular articles of wordpress blog in sticky footer. The code I am going to share with you will display 5 most commented articles in a cool sticky footer with their thumbnails as well. So let’s begin.

Before moving to code, it is required that you should install wordpress popular posts plugin to your wordpress blog. Once installed the plugin, activate it and follow the steps below.

Steps to display popular articles of wordpress blog in sticky footer

  • As usual login to your WordPress blog
  • Navigate to “Editor” under “Appearance” option
  • Now click on “Main index template” (index.php) and insert the code given below after <?php get_footer(); ?> (bottom area of the code), be sure to backup your existing source code before adding this code for safety.
<!—top 5 popular articles of your wordpress blog in a sticky footer -->
<div style="width:100%; height:50px; margin:0 auto; position:fixed; bottom:0; background-color:#F0FEFF; border-top:#09C solid; color:#FFF;">
<div style="width:140px; height:50px; line-height:50px; vertical-align:central; float:left; padding-left:5px; background-color:#09C; text-align:center">
Popular Stuff>>
</div>
<?php
ob_start();
$args = 'range=all&limit=5&stats_comments=0&thumbnail_width=40&thumbnail_height=40';
wpp_get_mostpopular($args);
$popular = ob_get_clean();
$popular = explode('</li>', $popular);
$popular_counter=1;
foreach ($popular as $p)
{
$p = str_replace('<li>','<div style="float:left;width:200px; margin-top:4px">',$p);
$p = str_replace('<ul>','',$p);
$p = str_replace('</ul>','',$p);
$p = str_replace('<img ','<img style="vertical-align:middle;float:left; margin-right:5px; margin-left:5px "',$p);
echo $p."</div>" ;
$popular_counter++;
}
?>
  • Update the source code by pressing “Update file” button below. That’s it, now you are ready to test it. Now you will get a cool sticky footer with top 5 most commented articles of wordpress blog.

Here is how the sticky footer will display in your wordpress blog

popular articles of wordpress blog in sticky footer

Kindly give us a back link if you are using this source code in your WordPress blog. Thank you

 

- Advertisement -

Latest News

Four Things You Most Likely Didn’t Know About Guest Post Service

Guest Posting is a great way to raise awareness and build links. However, before starting a guest...

How Does Blogger Outreach Help Your Brand Grow?

Bloggers are eager to promote their content and engage their readers, so building relationships with them are essential to growing your brand....

How To Get Your Startup Noticed

Being an entrepreneur is always a learning experience. That's because the rules are constantly changing. The change happens so subtly that you...

The Benefits of Treemapping for Data Analysis

Treemapping is a great tool for data analysis because it allows you to see the big picture and the details at the...

Tips for driving more traffic to your engineering blog

Over the last two decades, blogging has transformed from being a somewhat hobbyist pursuit to a fully-fledged sector of the internet that...

More Articles Like This

- Advertisement -