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>
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 ?
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.
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
Hi Elliot,
This is exactly what I was looking for. Thank you for your help.
Have a great day,
Nikolai