How to display content or div only on Homepage of wordpress websites - Free Asp.Net,MVC,AngularJs,Jquery,Javascript,Sql Server,WCF,Entity framework snippets and tutorial

How to display content or div only on Homepage of wordpress websites

Introduction: In this article today I will explain how we can display content or div only on Homepage of wordpress websites

Description:
Some time in wordpress we have to show content or div only on home page of website.
e.g. I have to show pic/photo in footer only on home page. To fulfill the requirement we can create new home page template(home.php) or simply add a php code in footer.php file of theme. Here I have add the below given code in footer.php file:


<?php if (is_front_page()) { ?>
<img src=""/>
<?php } ?>

You can also CSS style:

<?php if (is_front_page()) { ?>
<div class="footerhome">
<h1 style="font-size:20px">Welcome</h1>
</div>

<?php } ?>

Is this article helpful for you?

If yes post your comment to appreciate my work and fell free to contact me. You can like me on Facebook, Google+, Linkedin and Twitter via hit on Follow us Button and also can get update follow by Email.

What do you think about this article?

If you found this article useful, please share and follow on Facebook, Twitter, Google Plus and other social media websites. To get free updates subscribe to newsletter. Please put your thoughts and feedback in comments section.

Share this

Share on FacebookTweet on TwitterPlus on Google+


EmoticonEmoticon