I can't figure out why thisis not working. It works correctly if I just have 'events' but when I added 'guide' and 'firm-news' it doesn't changes those templates. I need to push then to H5 for SEO because we have multiple H1 tags on thousands of pages. Please help if you know what I'm doing wrong. Thank you!
<?php //if is single event, guide, firm news
if ( is_singular('events','guide','firm-news') ) : ?>
<h5 class="event-subpage-header-title"><?php echo $title; ?></h5>
<?php else : ?>
<h1><?php echo $title; ?></h1>
<?php endif; ?>
I can't figure out why thisis not working. It works correctly if I just have 'events' but when I added 'guide' and 'firm-news' it doesn't changes those templates. I need to push then to H5 for SEO because we have multiple H1 tags on thousands of pages. Please help if you know what I'm doing wrong. Thank you!
<?php //if is single event, guide, firm news
if ( is_singular('events','guide','firm-news') ) : ?>
<h5 class="event-subpage-header-title"><?php echo $title; ?></h5>
<?php else : ?>
<h1><?php echo $title; ?></h1>
<?php endif; ?>
Share
Improve this question
asked Nov 1, 2019 at 17:09
Naomi HarperNaomi Harper
1
1 Answer
Reset to default 0You actually doing mistake. You have to pass 3 parameters as array not like this. Use below code
<?php //if is single event, guide, firm news
if ( is_singular( array('events','guide','firm-news') ) ) : ?>
<h5 class="event-subpage-header-title"><?php echo $title; ?></h5>
<?php
else :
?>
<h1><?php echo $title; ?></h1>
<?php
endif;
?>