WordPress.org

Ready to get started?Download WordPress

Forums

How to get the nicename of a parent category? (2 posts)

  1. Cathy Tibbles
    Member
    Posted 4 years ago #

    I am creating a link to help users navigate backwards in a category template.
    What works:

    <a href="<?php
    //this link works perfectly
    echo get_category_link ( $category->category_parent );?>">
    Back to <?php
    //this displays the parent category id number
    echo the_category($category->category_parent);?></a>

    The above returns:
    Back to 10
    With the link in tact, and the 10 being the current category's parent cat ID.

    How do I get it to simply list he category nice name based on the ID above?

    Thanks!

  2. alchymyth
    Forum Moderator
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic