matt inertia
Member
Posted 5 months ago #
Hi guys,
I use this bit of code quite a lot:
<?php if (is_home()) : ?>
<h1>....title...</h1>
<p>...content etc...</p>
<?php endif; ?>
...which is all you need if you want to hard code some content into the home page which will not appear on any other page which uses the same template.
That works fine but it doesnt stop the content appearing on the other "older posts" pages. Does anyone know how or what codex i need to ensure that content only displays on the very top page?
With the help of the Template Hierarchy article, determine what Template is displaying your archives ("older posts") and delete the instance of the template tag, the_content(), in that file.
Instead of is_home, try is_front_page. That worked for me when I faced this.
matt inertia
Member
Posted 4 months ago #
@ousep - ive tried this but it didnt work... still displays the content wrapped in the is_front_page php code no matter what page it is.
@michaelH - the template for my older posts page is the same as my home page.