fbpx
How to Display Content Only on the WordPress "Front Page"

How to Display Content Only on the WordPress “Front Page”

If you only wish to show content only on the WordPress front page, you can do so by wrapping the content in a is_page (is_front_page) conditional statement. You can also choose to display content on all pages BUT front page by adding “!” to your statement.

Instructions
Insert content as shown below.

<?php if (is_front_page()) { ?>
... whatever you put here will only be shown on the front page.
<?php } ?>

Related Links:
Source: http://codex.wordpress.org/Conditional_Tags
Source: https://developer.wordpress.org/reference/functions/is_page/

WordPress Hosting

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress Snippet Info

Tested with Wordpress v. 4.8

How to Display Content Only on the WordPress “Front Page”
4.7 (93.33%) 15 vote[s]
Please report broken snippets.
Report Broken Snippet
WordPress Hosting - WP Engine

Recent Comments