0

I have the following code:

<?php
 if ((is_home()) OR (!is_single()) OR (!is_page('171'))) : ?>
    <body>
<?php else: ?>
    <body class="last-page">
<?php endif; ?>

However it doesn't seem to work as expected. I want the class "last-page" to be applied to the body of the page with the id of 171 and pages that display single posts. If I take the third condition out, the "last-page" class is applied correctly to single post pages but with the third condition there it doesn't get applied to any of the two.

I want the "last-page" class to be applied to both single post pages and page 171.

Appreciate the help.

0

from your verbal desription, i would think this should work:

<?php  if ( is_single() OR is_page('171') ) : ?>
<body class="last-page"> 
<?php else: ?>     
<body>
<?php endif; ?>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.