Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #361424

    Hi guys,

    Could someone point me in the right direction? What is the most efficient way to add custom class to the logo link element using a Child Theme or Child Theme’s functions.php?

    In need the A link tag within the STRONG class=”logo” to have an own custom class. Here is an example of what I am looking for:

    <strong class="logo">
    <a href="#my-homepage" class="My Custom Class">
    <img height="X" width="X" src="My-Logo-Image.png" alt="My ALT Text" />
    </a>
    </strong>
    • This topic was modified 9 years, 11 months ago by Nikolai.
    #361444

    what is the point you want to achieve?

    because you can select the anchor by :
    .logo > a { }

    so why you need an extra class vor a ?

    #361644

    Hi Guenni007,

    Thank you for your response. I am not going to use it for styling.

    I need to trigger an event when the logo is clicked, therefor I need to have a custom class applied to the link.

    Any idea’s on how to make this happen in an efficient way? I am using a child theme.

    Thanks.

    #361822

    Hi!

    Are you using jQuery? If so then you can target it like so.

    jQuery('.logo > a').on('click', function(){
    // do stuff here
    });

    Otherwise you can find it on line 499 in /enfold/framework/php/function-set-avia-frontend.php.

    $logo = "<$headline_type class='logo'><a href='".$link."'>".$logo."$sub</a></$headline_type>";
    

    Best regards,
    Elliott

    #362062

    Hi Elliot,

    This is exactly what I was looking for. Thank you for your help.

    Have a great day,

    Nikolai

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘How to add custom class to the logo link?’ is closed to new replies.