<?php if( is_home() || is_page(10)): ?>
<div class="text-center col-xl-12 col-lg-12 col-md-12 col-sm-12 col-xs-12">
<?php elseif(is_single() && !is_page(10)): ?>
<div class="text-center col-xl-9 col-lg-9 col-md-9 col-xs-12">
<?php endif; ?>
All I'm trying to do is change the classes assigned to this <div>
if you are on a single post, which works fine, but I can't get it under control when viewing a contact page, which it seems to recognize as a single post. This is fine, but I want to exclude one page from this effect.
I've tried is_page('Contact'), is_page('contact'), and is_page(10) None of them seem to return true in any case, I even deleted all other conditionals and just had it print something if its the contact page, but it still doesn't return true and has no effect.
I've done a lot of searching and all I can find says I'm using it correctly.. I'm at a loss as to why it wouldn't return true?
Am I using php if statements incorrectly and it's been an 'oops, it worked' scenario thus far? The url to the page ends with ?page_id=10, the page is titled 'Contact'
I could create a page template, but it seems more than what I need here, the contact page is painfully simple, and all I really need to do is center the four lines of text appropriately using bootstrap. Works fine across all other pages of the website, and changes the <div>
appropriately if you're on the homepage or viewing a single post.
As requested, the full index.php code is below. Thanks to anyone who is willing to look at this. It is nothing massive, I am relatively new so please excuse my excessive commenting - I'm still learning. Full index.php: https://pastebin.com/nnG0ny99