• Header Banner Image links by default to rel=`home’. I need to remove the link or change it to a custom url. I guess this can be done adding a function to my Child Theme functions.php but so far I could not get the correct code. Please help!

    Customization of Header Banner Image on a page basis is a fantastic feature of the Hueman Theme. It would become superlative if the associated link could also get customized!

    Thanks you all.
    Darío

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter Darío Orlando Fernández

    (@soykatorce)

    Solved!

    I just overrode hu_render_header_image function in my child them functions.php

    The orinal theme function is located in init-front.php under heading Header image callback and the original code is:

    if ( ! function_exists( 'hu_render_header_image' ) ) {
      function hu_render_header_image( $_header_img_src = null ) {
        echo sprintf('<a href="%1$s" rel="home"><img class="site-image" src="%2$s" alt="%3$s"></a>',
            home_url('/'),
            get_header_image(),
            get_bloginfo('name')
        );
      }
    }

    To remove the link change code to

    if ( ! function_exists( 'hu_render_header_image' ) ) {
      function hu_render_header_image( $_header_img_src = null ) {
        echo sprintf('<img class="site-image" src="%2$s" alt="%3$s"></a>',
            home_url('/'),
            get_header_image(),
            get_bloginfo('name')
        );
      }
    }

    To set a link other than home replace string %1$s with your custom URL and change the string home with whatever you wish.

    Cheers,
    Dario

Viewing 1 replies (of 1 total)
  • The topic ‘Header Banner Image Link’ is closed to new replies.