I have the following code as a Loop in my category.php page. Its showing a dynamic banner when its coming from home page to this paape. I tried to filter by slug. and put them in else if loop. There will be several pages. But its showing an error.
syntax error, unexpected 'elseif' (T_ELSEIF)
<?php if($category_slug=='abc-bed'){?>
<div id="catHero">
<div id="blackPostBox" class="<?php echo "cat_id_" . $category_slug?>">
<h1 id="cath1"><?php echo $root[0]->post_title ?></h1>
<hr class="color-strip">
<p><?php echo $text = apply_filters('the_excerpt', get_post_field('post_excerpt', $root[0]->post_content ));?></p>
<div class="searchbar"><?php get_search_form(); ?></div>
</div>
</div>
<?php elseif ($category_slug=='abc_efg') {?>
# code...
<?} ?>
<?php else ($category_slug=='abc_rrg') {?>
# code...
<?} ?>
<?php }?>
Aucun commentaire:
Enregistrer un commentaire