How to add HTML code on WordPress home page

Some time we want to show Some custom text or HTML code on home page. In this article we given tricks and steps to add HTML code on WordPress home page.

How to add HTML code on WordPress home page

  • First method

you need go to wordpress admin panel.Create page with home name. Add your HTML or custom text in that page.

Go to Setting->reading section. There is “Front page displays”  section. We can found following two radio box over there.

  • Your latest posts
  • A static page (select below)

Select “A static page (select below) ” radio box. Than from “Front page:” select box, select the Home page. That sit.

How to add HTML code on WordPress home page
How to add HTML code on WordPress home page
  • Second Method

If you want to add some different text or HTML code, than you need open functions.php file which you found in wordpress themes folders. Just copy and paste following code in that file.


<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php

if (is_home() {
echo "HTML CODE GOES HERE OR TEXT";

}

?>

Note: You need replace HTML code. I used sample text in code.

Have fun!

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

Leave a Reply

Your email address will not be published.