0

I am making a wordpress theme and i want to have some of the page templates with an extended header div tag so i can add extra things in.

This is the code i have:

<?php if (!is_page_template('page-homepage.php')) { echo "</div>"; } ?>

I want it so i can have alternatives to the page-homepage.php so for example page-team.php as i want that individual page template to not close the div yet either, i tried writing this but it just does every page:

<?php if (!is_page_template('page-homepage.php' or 'page-team.php')) { echo "</div>"; } ?>

Any ideas? My php skills are not very advanced!

thanks :D

1 Answer 1

2

You are making a logical operation on two strings ('page-homepage.php' or 'page-team.php') which evaluates to true, so the statement becomes:

<?php if (!is_page_template(true)) { echo "</div>"; } ?>

Try this instead:

<?php if (!is_page_template('page-homepage.php') && !is_page_template('page-team.php')) { echo "</div>"; } ?>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.