Future PHP error?

I have been getting this warning on sites on my local server.
Warning: Use of undefined constant hp - assumed ‘hp’ (this will throw an Error in a future version of PHP) in F:\TestingServer\htdocs\localsites.…-child\homepage.php on line 7
Line 7 is <?php get_header(hp); ?> to include the content of header-hp.php
If this is soon to become invalid what should I use instead

2 Likes

You need to put “hp” in quotes. e.g.:

<?php get_header('hp'); ?>

I think that should do it.

4 Likes

Yes that cured it. All the other instances of get_… have the quotes.
Looking at a screen too long
Thank you

6 Likes

Yep. Been there, done that. :crazy_face:

5 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.