So, Let’s say you want to place an extra area under your header on your WordPress site. Welcome to the world of conditional tags.

So to place an element on the main blog page use the following:

<?php
if ( is_home() ) {
// This is a homepage
} else {
// This is not a homepage
}
?>

<?php

if ( is_home() ) {

// This is a homepage

} else {

// This is not a homepage

}

?>

For the front page use:

is_front_page()

For a post you can use:

is_single( '5' )
When post ID “5” is being used
is_single( 'Learn WordPress' )

For a page:

is_page( '10' ) - 10 being the page ID

Give it a try on the theme template!