Support » Fixing WordPress » linking to category

  • Resolved newbie63


    I have a list of categories on the right side of the page. However, I’d like to be able to make a link within the post that would link to the category. I know how to use the Editor to link a post to another post, or another page. But sometimes it might be useful for the reader to be able to go straight from the post to a category listing of all the rest of the posts in that category, rather than having to find the category on the side of the page. Is there an easy way to do this? (I’m not up to changing code in the theme, etc.)

    I haven’t actually posted the exact page on which this occurs. If that’s necessary, let me know and I’ll post it and link it to this query.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • You can either link directly to the category page in the blog post, which will depend on your permalink structure, i.e.:

    Or, add the category link to your blog post template, which would be something along these lines (sorry, I can’t test it right now):

    <?php $category = get_the_category();
    $firstCategory = $category[0]->cat_name; echo $firstCategory;?>

    Adding it in the blog post template looks beyond my understanding–I don’t even have a clue where that would be! So adding link directly in the blog post seems reasonable.

    In case someone else has the same issue, I added the link through the normal link icon on the editor. I had to go to the category from the category list to find the permalink, but once I’d worded it correctly, it worked marvelously.

    I knew it was easy…just didn’t know where to start.

    Many thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘linking to category’ is closed to new replies.