Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #322173

    Hi,

    I want the link on the header logo to point to a different page: http://www.domain.com/home instead of http://www.domain.com
    Now I found this thread: https://kriesi.at/support/topic/header-logo-url-change/ which pointed me in the right direction, but I want to do it in the enfold-child functions.php file. I don’t know php though and therefor could not figure out what the code should be.
    Could you please help me out?
    Thanks,
    Stephen

    This is what I created in the functions.php file. It is not working but it shows what I was attempting to do:

    /*Change the header link to point to the home page instead of the default domain*/
    add_filter(‘avf_logo_link’, ‘avia_logo’);
    function avia_logo() {
    $link = apply_filters(‘avf_logo_link’, home_url(‘/home’));
    return $link;
    }

    #322218

    Hey!

    Try using this code instead:

    add_filter(‘avf_logo_link’, 'change_logo_url’);
    function change_logo_url() {
    $link = "http://kriesi.at";
    return $link;
    }

    Best regards,
    Josue

    #322320

    Excellent, it works! This saves me a lot of research time.
    Thank you very much.
    This is the code I used in the end:

    add_filter(‘avf_logo_link’, ‘change_logo_url’);
    function change_logo_url() {
    $link = home_url(‘/home’);
    return $link;

    #322322

    You are welcome, glad to help :)

    Regards,
    Josue

    #338511

    Hi,

    I just discovered that in the bread crumbs section beneath the header, the home page is still pointing to http://www.abundantforever.com instead of http://www.abundantforever.com/home.
    For example this post: http://www.abundantforever.com/posts/master-your-life-by-mastering-your-thoughts/ shows the bread crumbs “You are here:Home / Blog / Awareness / Master your life by mastering your thoughts (video)”, but the home link should go to the page “Home”.
    What do I need to do to fix that?
    Thanks,

    Stephen

    #338563

    Hi Stephen,

    Open /enfold/framework/php/class-breadcrumb.php and look for line 209:

    $trail[] = '<a href="' . home_url() . '" title="' . esc_attr( get_bloginfo( 'name' ) ) . '" rel="home" class="trail-begin">' . $show_home . '</a>';
    

    Replace it by this:

    $trail[] = '<a href="' . home_url() . '/home" title="' . esc_attr( get_bloginfo( 'name' ) ) . '" rel="home" class="trail-begin">' . $show_home . '</a>';
    

    Regards,
    Josue

    #338629

    Thank you Josue.
    Instead of updating the file class-breadcrumb.php, can’t I just add a small piece of code to my functions.php file in my enfold child theme? I prefer to use the child theme instead of changing theme files.

    And just out of curiosity, if I set the home page to page “Home”, why is the breadcrumb not picking up that page? Is this a bug or is there a logical explanation for it?
    Thanks,

    Stephen

    #341134

    Hi Josue or somebody else. Could you please replay on my last question:
    Instead of updating the file class-breadcrumb.php, can’t I just add a small piece of code to my functions.php file in my enfold child theme? I prefer to use the child theme instead of changing theme files.

    And just out of curiosity, if I set the home page to page “Home”, why is the breadcrumb not picking up that page? Is this a bug or is there a logical explanation for it?
    Thanks,

    Stephen

    #341809

    Hi Stephen!

    What you set there is the “homepage page” to show, but the “homepage url” will always be ‘/’ (that’s why we have to re-declare the home URL in the logo, breadcrumb, etc) unless you change that in Settings > General.

    Regards,
    Josue

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.