0

I want to display the category Name by using category ID with link to category page (out side the loop).

here is my code...

<a href="<?php get_category_link('23'); ?>"><?php echo get_the_category_by_id(23); ?></a>

it's ok, but only think is it's go to home page... instead of category page... something missing... which i'hv not understand...

1
  • Click the check mark to mark the answer as The Solution.
    – fuxia
    Commented Dec 18, 2012 at 11:47

1 Answer 1

1

You need to echo your link:

<a href="<?php echo esc_url( get_category_link('23') ); ?>">
    <?php echo get_the_category_by_id(23); ?>
</a>
1
  • 1
    Then mark the answer as the answer, use the checkmark (✔).
    – fuxia
    Commented Jun 11, 2012 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.