Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • I just found a way better solution. 🙂

    Go to this topic and download the plugin posted by Kafkaesqui.

    To make category links on posts and pages nofollow just add this line to the code:

    add_filter('the_category', 'szub_nofollow_tag');

    Should work with the other ones too.

    Hi there I just started using WP and came across the same problem. Your post was the only thing I could find about it here in the support area.

    I just figured out a solution, I hope this helps you.

    <a href="<?php echo get_category_link($cat);?>" rel="nofollow"><?php
    foreach((get_the_category()) as $category) {
        echo $category->cat_name . '';
    }
    ?></a>

    This will return the category of the post and make it a nofollow link with the name of the category as the anchor text.

    On my blog I am not posting posts to multiple categories, only one category per post, so if you are posting to multiple categories this code will need to be tweaked a bit so the anchor text looks nice. Just put a , or a space between the single quotes in this line:

    echo $category->cat_name . '';

    and it should look fine.

    Namaste

Viewing 2 replies - 1 through 2 (of 2 total)