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:
For a page:
is_page( '10' ) - 10 being the page ID
Give it a try on the theme template!