Hi, WordPress Friends
I have this code below, it shows a output from the category slug, on the website. I want it to give it's output only in the code.
// In that way I can use the slug as a direction for a php include based on the category.
How do I fix this? (I assume I need to change echo?)
<?php
if (is_category( )) {
$cat = get_query_var('cat');
$yourcat = get_category ($cat);
echo $yourcat->slug;
}
?>