Display IF Homepage Only
-
Hi guys,
There was a section on my homepage in the header.php where I wanted to add content from a page ID, it worked for me and looks like this.
<?php
$page_id = 1493;$page_data = get_page( $page_id );
echo apply_filters(‘the_content’, $page_data->post_content);
?>Because this is in the header.php file it is displaying on every page, blog, posts etc when I only want it on the homepage.
What code do I add to say IF Homepage to display Else don’t display the content????
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Display IF Homepage Only’ is closed to new replies.