• i want to nofollow contact us, about us, privacy policy and disclaimer pages that are in the navigation bar.

    as this is the code in the function_list_pages_flat()

    // Add post ID to nofollow separated by comma
    $nofollow_posts = array(1, 2);
    
    if ( in_array( $page->ID, $nofollow_posts ) )
    	$nofollow = ' rel="nofollow"';
    else
    	$nofollow = '';
    
    $output .= $indent . '<li class="' . $css_class . '"><a '. $nofollow . 'href="' . get_page_link($page->ID) . '" title="' . attribute_escape(apply_filters('the_title', $page->post_title)) . '"><span>' . apply_filters('the_title', $page->post_title) . '</span></a></li>';

    where to exactly add the contact us, about us, privacy policy and disclaimer page urls and the page IDs for these four pages.

    My PHP/CSS knowledge is quite limited.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I think the ‘rel=nofollow’ should be applied to the href, not the a tag.

    Correct this for other reasons also such as proper syntax:

    $output .= $indent . '<li class="' . $css_class . '"><a '. $nofollow . 'href="' . get_page_link($page->ID) . '" title="' . attribute_escape(apply_filters('the_title', $page->post_title)) . '"><span>' . apply_filters('the_title', $page->post_title) . '</span></a></li>';

    Thread Starter sony120

    (@sony120)

    Thanks for your reply, as My PHP/CSS knowledge is quite limited.

    can you please provide more information on
    where to exactly add the contact us, about us, privacy policy and disclaimer page urls and the page IDs for these four pages in the code given by you.

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘cant able to edit nofollow code in functionslistpages’ is closed to new replies.