Hello,
Is it possible to change te url only on the homepage on the logo element?
I’ve seen this post:
https://kriesi.at/support/topic/changing-the-header-logo-link/#post-661402
But that’s for all the pages. Maybe put the functions in a code block on the homepage?
The reason I’m asking is because I want to but a button on the same place as the logo in stead of the logo.
Maybe there is an other possibility, for example placing a custom block on the same place as the logo?
Greets Jeen
Hey Jeen,
Thanks for getting in touch with us!
Please try adding the following code to you functions.php file:
add_filter('avf_logo_link','av_change_logo_link');
function av_change_logo_link($link)
{
if(is_page(59)){
$link = "http://kriesi.at";
}
return $link;
}
Note that you need to change the ’59’ to the page id of your homepage.
Best regards,
Jordan
Hello Jordan,
Thanks for the quick response. I’ve missed your email so that’s why I haven’t reached back to you.
Code works perfect. Thank you! Is it also possible to add a target=”_blank” to the URL?
Greets Jeen
Hey!
Please add following code to Functions.php file as well
function logo_attr(){
?>
<script>
jQuery(window).load(function(){
jQuery('.logo a').attr('target','_blank');
});
</script>
<?php
}
add_action('wp_footer', 'logo_attr');
Cheers!
Yigit
Hello Yigit.
Is it also possible to do this on a page? So only homepage target=”_blank”?
Gr. Jeen
Hey!
Yes, please change the code to following one
function logo_attr(){
?>
<script>
jQuery(window).load(function(){
jQuery('.home .logo a').attr('target','_blank');
});
</script>
<?php
}
add_action('wp_footer', 'logo_attr');
Best regards,
Yigit
Yigit! You’re a boss! Thanks. Everything works perfect!
Gr. Jeen
Hi,
Glad we could help! We really appreciate it if you rate our theme on themeforest .
To know more about enfold features please check – http://kriesi.at/documentation/enfold/
Thank you for using Enfold :)
Best regards,
Vinay