WordPress Category Link get_category_link(id)

I need to link to a category in my wordpress site. The following code works, somewhat:

                <?php
 // Get the ID of a given category
 $category_id = get_cat_ID( 'People' );

 // Get the URL of this category
 $category_link = get_category_link( $category_id );
    ?>

My problem is that it includes /category/ in the url, which isn’t how my permalink structure is designed. Does anyone know a way around including /category/ in the url it outputs?

Related posts

Leave a Reply

2 comments

  1. I don’t understand what you want to do. Look here Template Tags/wp list categories « WordPress Codex for the template tag for category menus that will include whatever category base you have set. If you want to output the link to a category on the category page itself, then use:

    <a href="<?php bloginfo('url'); ?>/<?php $category = get_the_category(); echo $category[0]->category_nicename; ?>" title="<?php echo $category[0]->category_nicename; ?>">
    
    <?php $category = get_the_category(); echo $category[0]->category_description; ?></a>