Category & page If Block
-
Hello all,
I have a client I am working with. He wants to have a different masthead for every category page and every “page”. I have figured out the HTML and the CSS, which works. It is working on the category archive pages, and the home page. It just is not working on the About, Contact, and News page. I am not sure why, as the syntax of the if block looks right to me. I have pasted the if block below. Here is the URL of the site, so you can look at it if you need to: https://www.fromthecrib.com/blog/
Here is the if block:
<?php if (is_category(‘5’) ): ?>
<div id=”masthead-dear-baby”>
<span><?php single_cat_title(”); ?></span>
</div>
<?php elseif (is_category(‘4’) ): ?>
<div id=”masthead-comic-strip”>
<span><?php single_cat_title(”); ?></span>
</div>
<?php elseif (is_category(‘3’) ): ?>
<div id=”masthead-baby-blog”>
<span><?php single_cat_title(”); ?></span>
</div>
<?php elseif (is_home() ): ?>
<div id=”masthead-home”>
<span><?php single_cat_title(”); ?></span>
</div>
<?php elseif (is_page(‘2’) ): ?>
<div id=”masthead-about”>
<span><?php single_cat_title(”); ?></span>
</div>
<?php elseif (is_page(‘3’) ): ?>
<div id=”masthead-contact”>
<span><?php single_cat_title(”); ?></span>
</div>
<?php elseif (is_page(‘4’) ): ?>
<div id=”masthead-news”>
<span><?php single_cat_title(”); ?></span>
</div>
<?php else: ?>
<div id=”masthead-home”>
<span><?php single_cat_title(”); ?></span>
</div>
<?php endif; ?>Please reply soon! The client is waiting for this update ASAP!
Thank you!
- The topic ‘Category & page If Block’ is closed to new replies.