Title / Slug swap
-
<?php } elseif (is_single()) { ?> <?php $category = get_the_category(); $catlink = get_category_link( $category[0]->cat_ID ); echo ('<a href="'.$catlink.'">'.$category[0]->cat_name.'</a> '.'<span class="raquo">»</span> '.get_the_title()); ?>
gives me: Home ? Testimonial ? Anne & Chris
<?php } elseif (is_category()) { ?> <?php if (is_category()) { $yourcat = get_category ($cat); echo ''.$yourcat->slug; } ?>
gives me: Home ? Testimonials
I’m wondering how I go about making the first snippet of code display slugs vs category titles. I always seem to end up with an error which ever way I shake it.
Any help would be greatly appreciated.
- The topic ‘Title / Slug swap’ is closed to new replies.