I’ve been using this if
conditional statement to only show content if the current page is NOT using a certain page template;
if (! is_page_template('template-custom.php')) {
<!-- show some content -->
}
which has been working fine. Only now I need to amend the statement to show content if the current page is NOT using one of 2 templates (So if the current page uses template-custom.php
or template-custom2.php
do NOT show the content).
I tried this;
if (! is_page_template('template-custom.php') || is_page_template('template-custom2.php')) {
<!-- show some content -->
}
and this;
if (! is_page_template('template-custom.php') || ! is_page_template('template-custom2.php')) {
<!-- show some content -->
}
but to no avil.
Any suggestions?
If you want don’t want to show content if the current template is
template-custom.php
ortemplate-custom2.php
you can use:or
According to De Morgan’s law
try this: