WordPress.org

Ready to get started?Download WordPress

Forums

Get Category Slug (1 post)

  1. depiction
    Member
    Posted 6 years ago #

    Is there a way to retrieve the category slug? I would like to use it in place of <?php echo $category_nicename; ?> below.

    <?php if (is_home())
          query_posts("showposts=10&cat=3");
    ?>
    	<?php if (have_posts()) :?>
    	<?php
    	$category = $wp_query->get_queried_object();
    	$cat_name = $category->name;
    	?>
        <div class="right_header"><span class="right_header_text"><a href="<?php echo get_settings('home'); ?>/index.php/category/<?php echo $category_nicename; ?>"><?php echo $cat_name; ?></a></span></div>

Topic Closed

This topic has been closed to new replies.

About this Topic