WordPress.org

Ready to get started?Download WordPress

Forums

Yoast Breadcrumbs
Home link to the current page (5 posts)

  1. myvcc
    Member
    Posted 2 years ago #

    Hi,

    I've installed Yoast Breadcrumbs and everything is working fine except that the Home is linking to the current page instead of the main page.

    For example I have a page:

    Home >> Support >> FAQ

    Instead of linking to the home page, the Home link point to the FAQ page itself such as http://www.domain.com/support/faq/

    How do I fix this?

    Thanks in advance for your help.

    http://wordpress.org/extend/plugins/breadcrumbs/

  2. myvcc
    Member
    Posted 2 years ago #

    Anyone please?

  3. myvcc
    Member
    Posted 2 years ago #

    Yes no?

  4. gilzow
    Member
    Posted 2 years ago #

    i ran into this as well. If I remember correctly, line 212 in yoast-breadcrumbs.php, if you dont have the 'page_on_front' option set in your wordpress install, then get_option returns a 0 which causes get_permalink to return a link to the page the user is on. What I did was add a check to get_option('page_on_front') where if it is 0 then do get_bloginfo('url') otherwise go ahead and do get_permalink.

    something like:
    $homelink = '<a'.$nofollow.'href="'.(0 == $intPageOnFront = get_bloginfo('page_on_front')) ? get_bloginfo('url') : get_permalink($intPageOnFront).'">'.$opt['home'].'</a>';

  5. myvcc
    Member
    Posted 2 years ago #

    Hi gizlow,

    Thank you very much for the pointer. Instead of editing the code, I got the idea to just change the "Front page displays" to "Your latest posts" under the Reading Settings.

    The theme that I am using is using a customized front page, so as long as I don't set it to a static page, this should be OK I think.

    Thanks again.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic