Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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...

share|improve this question
    
Click the check mark to mark the answer as The Solution. –  toscho Dec 18 '12 at 11:47

1 Answer 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>
share|improve this answer
    
Thanks Eugene it's working..... –  user16967 Jun 11 '12 at 14:43
1  
Then mark the answer as the answer, use the checkmark (✔). –  toscho Jun 11 '12 at 14:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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