HOW add a Link in the index banner

Hello !

I would like to insert a link in my banner picture, in the main page of my website

Could you tell me what is the css code to perform that ?

Regards
Stefan


Comments

  • Hi 
    Thanks for asking query to us.
    See the snapshot  and confirm me are you want  to make header image clickable.
    Kindly clear us so that we can assist you better. 

    Thanks 
    Prime 

  • Hello prime !
    Thanks for your answer !

    Yes that 's it ! i want to make a header image clickable.
    The url to follow is : https://cutt.ly/BeVA3Nv

    Regards
    Stefan from France
  • edited March 30
    Hello
    To do so, you need to create a child theme, For creating a child theme refers this link .
    Ignore if you have already created child theme. 
    After it copy the header.php file from parent theme directory and past it inside the child theme directory.
    Then again edit the file  and find the below line of code on line no 31

    <img src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="" />
    And replace it with below line of code.

    <img src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="" />
    </a>

    You can change href  value as your need.
    Let me know for any confusion.

    Thanks
    Prime

  • Hello thanks for your answer !

    1) i created the child theme
    2) i rebuilt manually changes for th echild theme
    3) i modified the wp-config.php, using the theme editor.

    4) changes are ok in the web page after the request on the server :
    please see the beginning of the <head> tag :
    -------------------------------------------
    </head>
        <body class="home page-template page-template-template page-template-template-page-full-width page-template-templatetemplate-page-full-width-php page page-id-285 boxed" >
    <div id="wrapper">
       
    <header class="custom-header">   
       
        <div class="wp-custom-header">
            <a href="">
    <img src="https://stephane-bonnaud.fr/wp-content/uploads/2020/03/cropped-banderolle-3-bonne-REtaillee.png" height="278" width="1600" alt="S'abonner à la chaîne !" /> </a>
        </div>

    ------------------
    but the banner picture is not clickable !
    Have you got an idea please ??

    Regards
    Stefan



    Capture.PNG
    838 x 470 - 29K
  • Hi 
    Follow the below instruction.
    Simply  copy the code from this link and paste inside the header.php file of child theme.
    Then  again edit the header.php file of child them  and find the below line of code on line no 28 .
    Change url as your need.
    More help see the snapshot https://prnt.sc/rqlzbk.

    Let me know for  any confusion.

    Thanks
    prime
  • Hello

    i have pasted all the code (inside the header.php file) you gave to me and now it functions very well.

    I thank you very much !

    Take care of you

    Stefan


  • edited April 2
    Hi,

    Glad to help you!

    If you like our Theme & Support, rate us HERE.

    Thanks:)
This discussion has been closed.