• Not sure if I am just doing something weird but this has always worked for me before…

    <?php $cat_id = get_cat_ID('cat-slug'); ?>
    <a href="<?php echo get_category_link($cat_id) ?>">link</a>

    for some reason get_category_link is just returning nothing. I noticed that I can access the category weirdly enough via a simple /cat-slug off the main structure of the website. Is this new to 3.2.1? I thought this was only possible with pages previously and categories always had the /category/cat-slug URL. If I go into the admin and “view” the category, sure enough the URL is /category/cat-slug but in my code if I simply put:

    <a href="<?php bloginfo('home')?>/cat-slug">link</a> it works. Not that I am complaining really, this makes things easier, but I’m just wondering if something weird is going on?

    Thanks in advance.

  • The topic ‘Issue with get_category_link’ is closed to new replies.