Easy if you know how, but how?

Discussion in 'PHP' started by Jac, Dec 3, 2009.

  1. #1
    i want to add a no follow tag to the links page on my blogs blogroll,

    the code in my plugin looks like this

    <?php get_links('-1', '<li>', '</li>', '<br />', FALSE, 'id', FALSE, FALSE, -1, FALSE); ?>

    so i added

    <a href= <?php get_links('-1', '<li>', '</li>', '<br />', FALSE, 'id', FALSE, FALSE, -1, FALSE); ?> rel="nofollow"</a>

    but it does not show as a nofollow link when i check using firefox seo plugin

    am i doing something wrong with the code? im no expert at html or php.

    thanks in advance
     
    Jac, Dec 3, 2009 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The links are generated by the get_links function, therefore you are just placing the links inside of your <a tag>. get_links is a deprecated function of wordpress, you really should upgrade your theme to a newer version
    Try this
    <?php $links = get_links('-1', '<li>', '</li>', '<br />', FALSE, 'id', FALSE, FALSE, -1, FALSE); 
    echo str_replace('<a ', '<a rel="nofollow" ', $links);
    ?>
    PHP:
     
    JAY6390, Dec 3, 2009 IP