How to add copyright symbol with dynamic date in wordpress footer
Posted in How to, Wordpress By SureyeaAre you tired of updating the copyright date each year in your wordpress site? Here is a simple code that adds copyright symbol with dynamic date in wordpress footer. By adding this snippet you don’t have to update your copyright text each year.
We have seen in many sites that contains copyright symbol only with the current year and even some sites have outdated copyright year. The best way to have copyright text is by adding copyright symbol from the year started to the current year. By doing so; your site visitors will know the age of your website. In this article we will see how to add copyright symbol with dynamic date in wordpress footer.
How to add copyright symbol with dynamic date in wordpress footer
To add copyright symbol that updates dates automatically you can add this simple code in wordpress footer.php file. Make sure you change the year 2010 to the year started.
copyright © 2010-<?php echo date('Y'); ?> <?php bloginfo('blogname'); ?>
This code adds “copyright © 2010 – 2013 yourblogname” in your wordpress footer.
The above code is not the right solution for sites that are aged less than a year. If you change the year 2010 to 2013 then it simply shows “copyright © 2013 – 2013 yourblogname” which doesn’t looks good.
If your site is less than a year then add this following code in your footer.php and not the above one.
<?php $year = date('Y'); if ($year != 2013){ echo '© 2013 – '.$year.' YourSite.com'; } else { echo '© 2013 YourSite.com'; } ?>
The above php code adds copyright symbol with just the current year (© 2013 yoursite.com). So if your site becomes one year old then it automatically updates like this © 2013 – 2014 yoursite.com . Now you don’t need to update your copyright date each year.
Bonus – copyright symbol with dynamic date in wordpress footer
If you want copyright like this copyright © Mon/21/10/2013 yoursitename then add the following code in your wordpress footer.php file. This will update automatically each and every day.
copyright © <?php echo date("D/d/m/Y"); ?> <?php bloginfo('blogname'); ?>
Hope this helped you on adding copyright symbol with automatic updating of years and dates in your wordpress footer. Please share and comment below. Subscribe to get the latest blog updates.
Related Posts
- How to disable right click context menu on images in wordpress Internet becomes way easier to find whatever information’s like texts, images, media files etc. Content and images originates mainly from one place and that will be reproduced, modified and reused...
- How to change the author name in wordpress post If you are allowing user to post in your wordpress site as a guest blogging via emails (or) lets say you like an article from Ezine articles and you are...
- How to recover wordpress password on localhost Most won’t do coding; testing and designing in website that is live for that reason you will work in your local computer (localhost) and implement it online once it is...
- What is Gravatar? Why to use Gravatar and how to get Gravatar? One of my close friends asked me about how to get a picture in wordpress comment section. He also said that he sees some grey human icon, funny cartoonistic icons...
- How to find out what wordpress theme & plugins is being used in a site You might visit a wordpress site and wonder what wordpress theme is being used. Here in this post let’s see how to find out what wordpress theme & plugin a...