nofollow link for page?

Discussion in 'WordPress' started by bigu, Apr 30, 2010.

  1. #1
    Here is my site

    In header menu bar. I want to make "About" and "Privacy Policy" to "nofollow" link.

    How to do this?

    Please help me. Thanks.
     
    bigu, Apr 30, 2010 IP
  2. enjoythisdotnet

    enjoythisdotnet Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    umm not sure if your asking for this but

    <a rel="nofollow" href="http://www.example.com/">asdf</a>
     
    enjoythisdotnet, Apr 30, 2010 IP
  3. rilwis

    rilwis Peon

    Messages:
    104
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You can do this with some lines of PHP code:

    
    $output = wp_list_pages('echo=0'); // you can add more parameters here
    
    $output = str_replace('<a', '<a rel="nofollow"', $output);
    echo $output;
    
    PHP:
     
    rilwis, May 1, 2010 IP
  4. bigu

    bigu Well-Known Member

    Messages:
    1,205
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    100
    #4
    Rilwis: Can you tell me in details?

    Thank you.
     
    bigu, May 1, 2010 IP
  5. rilwis

    rilwis Peon

    Messages:
    104
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Open your header.php file, search the code for displaying pages, it must has this syntax: wp_list_pages('...'); and replace this code with the code above.
     
    rilwis, May 2, 2010 IP