Archived topic
Having a problem with hooks
4 replies · Started by Daniel on January 20, 2017
I'm trying to add some html before the header.
For some reason, it won't run. My page is called news
<?php if ( is_page( 'news' ) ) : ?>
<h1 style="color:black;">Hello</h1>
<?php endif; ?>
Hi Daniel,
Can you make sure that the “Execute PHP” checkbox is checked?
Also make sure news is the slug: yourwebsite.com/news
The slug is news and in settings/reading news is set as the blog page.
This is not working for me. If I change the php to 'about' for the about page it works and if I remove the php and just put <h1 style="color:black;">Hello</h1> it works for the news page.
Yes, I do have execute php enabled.
Something is not right :(
Can you try to replace is_page( ‘news’ ) with is_home()?
Let me know.