Tagged: header logo
-
AuthorPosts
-
January 26, 2021 at 10:41 am #1275432
Hey there,
I want to change the header logo link from my page.
I already included your suggested code to the functions.php from my child theme but it’s still not working.
Any idea why this code isnt working?Thanks and greetings,
MyleneAdded code:
// changes link for header logo
add_filter(‘avf_logo_link’,’av_change_logo_link’);
function av_change_logo_link($link)
{
$link = “https://google.at/”;
return $link;
}January 26, 2021 at 1:07 pm #1275471I managed to make it work with the following code:
// changes link for header logo
add_filter(‘avf_logo_link’,’av_change_logo_link’);
function av_change_logo_link($link)
{
$link = home_url(‘/subpage’);
return $link;
}Still I dont unterstand why it isnt working if I try to link any other page or if I am using the whole url not the home_url function.
Well, I changed it again to try an external link again and now the version mentioned above isnt working anymore..
I would appreciate any suggestions :)
Greetings, Mylene- This reply was modified 3 years, 9 months ago by gugler.
January 27, 2021 at 12:08 am #1275611Hi Mylene,
Where do you need it to lead to?
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
Best regards,
VictoriaJanuary 27, 2021 at 2:51 am #1275647because of:
$link = home_url(‘/subpage’);
you can use :add_filter('avf_logo_link','av_change_logo_link'); function av_change_logo_link($link){ $link = get_site_url().'/subpage'; return $link; }
or with your home_url function:
add_filter('avf_logo_link','av_change_logo_link'); function av_change_logo_link($link){ $link = get_home_url().'/subpage'; return $link; }
what is the difference – on most cases : no difference – but look to your dashboard – settings – general
there you got both defined.
If you install your wordpress in a subfolder – then they differs.but subpage is still not defined – so what do you want to achieve
- This reply was modified 3 years, 9 months ago by Guenni007.
January 27, 2021 at 9:12 am #1275671Thanks for your replies :)
I have tried Guenni007 solutions but they arent working. Do I have to wait a specific amount of time till the changes are recognized?
I cleared the cache aswell but no changes.Now I have the following code:
// changes link for header logo
add_filter(‘avf_logo_link’,’av_change_logo_link’);
function av_change_logo_link($link)
{
$link = ‘https://conference.zeroproject.org/zeroprojectconference2021’;
return $link;
}Per default the logo is linking to ‘https://conference.zeroproject.org/’.
According to other forum posts this should work but it doesnt.January 27, 2021 at 11:21 am #1275739Hi gugler,
Please update the theme to the latest version. That should fix any issues you are currently experiencing :)
To update to the latest version follow the simple instructions here. (Or if you want the super detailed explanation you can read this blog post)
Best regards,
VictoriaJanuary 27, 2021 at 12:01 pm #1275748i see that you are not working with a child-theme!
where did you enter the snippet?
add_filter('avf_logo_link','av_change_logo_link'); function av_change_logo_link($link){ $link = get_site_url().'/zeroprojectconference2021/'; return $link; }
Next: you have activated the merging of css and js files.
Did you refresh those files ?January 27, 2021 at 12:49 pm #1275767I am currently new to this project so I just experienced that my changed did work but only for the main site of my wp multisite.
So ‘https://zeroproject.org/’ is the main site of my multisite and the header logo is linking to the mentioned subpage.
What I really want is, that the header logo of ‘https://conference.zeroproject.org/’ is linking to the mentioned subpage.I am sorry for missing the multisite detail.
Thanks for your help!
January 31, 2021 at 7:07 pm #1276604Hi,
Sorry for the very late reply, please try this function instead.add_filter('avf_logo_link','av_change_logo_link'); function av_change_logo_link($link){ $host = "conference.zeroproject.org"; if ($_SERVER['HTTP_HOST'] == $host) { $link = get_site_url().'/zeroprojectconference2021/'; } else {} return $link; }
Then clear your browser cache and check.
Best regards,
MikeFebruary 3, 2021 at 8:20 am #1277266yes this little additional information that it is a multisite would have been good to know. ;)
February 4, 2021 at 7:37 am #1277606 -
AuthorPosts
- You must be logged in to reply to this topic.