Tagged: logo link
-
AuthorPosts
-
October 19, 2020 at 5:25 pm #1254099
Dear Enfold team,
I have recently encountered a hiccup.
I am running two enfold websites, one for informational purposes and one for a cart checkout.
At the moment my task is to link the logo on the checkout website back to the main website and the following solution previously found on the blog results in the website showing a white screen.add_filter(‘avf_logo’,’av_change_logo’);
function av_change_logo($logo)
{
$currentlang = get_bloginfo(‘language’);
if($currentlang==”en-US”)
{
$logo = “http://kriesi.at/wp-content/themes/kriesi/images/logo.png”;
}
if($currentlang==”fr-FR”){
{
$logo = “http://kriesi.at/wp-content/themes/kriesi/images/logo.png”;
}
return $logo;
}Looking forward to your reply.
AlexanderOctober 19, 2020 at 5:48 pm #1254110Hi Alex,
You can use this hook instead (just add the conditions inside it):
function enfold_change_logo_link($link) { $link = "http://website.com"; return $link; } add_filter('avf_logo_link','enfold_change_logo_link');
Hope it helps.
Best regards,
NikkoOctober 19, 2020 at 6:24 pm #1254120Hi Nikko,
Thank you for a quick reply!
I have more than one language at the moment, I can see that you included code for one language. Would you be able to advise a snippet of code for both languages?
I am not good at all with coding.Best,
AlexanderOctober 19, 2020 at 7:21 pm #1254124Hi Alexander,
I see, please try to use this code (just change the links/url):
function enfold_change_logo_link($link) { $currentlang = get_bloginfo('language'); if($currentlang=="en-US") { $link = "http://website.com"; } else { $link = "http://mywebsite.com"; } return $link; } add_filter('avf_logo_link','enfold_change_logo_link');
Best regards,
NikkoOctober 19, 2020 at 9:09 pm #1254142Hi Nikko,
Thank you lots for your help. Works perfectly!
The only question is if I add another language in the future, would I just add another else { into the equation, as mentioned below?
function enfold_change_logo_link($link) {
$currentlang = get_bloginfo(‘language’);
if($currentlang==”en-US”) {
$link = “http://website.com”;
} else {
$link = “http://mywebsite.com”;
} else {
$link = “http://mywebsite.com”;
}
return $link;
}add_filter(‘avf_logo_link’,’enfold_change_logo_link’);
Best,
AlexanderOctober 20, 2020 at 2:50 am #1254201Hi Alexander,
We’re happy to hear that :)
If you need to add another language you can use this code:function enfold_change_logo_link($link) { $currentlang = get_bloginfo('language'); if($currentlang=="en-US") { $link = "http://english_website.com"; } elseif($currentlang=="fr-FR") { $link = "http://french_website.com"; } else { $link = "http://default_website.com"; } return $link; } add_filter('avf_logo_link','enfold_change_logo_link');
if a fourth language is added then just add this before else
elseif($currentlang=="fr-FR") { $link = "http://french_website.com"; }
Best regards,
NikkoOctober 21, 2020 at 1:58 am #1254514Thank you thank you thank you !
October 21, 2020 at 2:06 am #1254517Dear Nikko,
This would be off topic but I was wondering if you could see why the transparent menu does not work on the cart page in one of the languages?
Here: https://shop.pearlsmile.com/de/
Looking forward to your reply
Best,
AlexanderOctober 21, 2020 at 7:22 am #1254564Hi Alexander,
Thanks for giving the link however I noticed when using a web inspector, it’s not tagged as a transparent header.
Please post us your login credentials (in the “private data” field), so we can take a look at your backend.- Install and activate ” Temporary Login Without Password “.
- Go to ” Users > Temporary Logins ” on the left-side menu.
- Click ” Create New “.
- Add the email address for the account ( you can use (Email address hidden if logged out) ), as well as the ” Role ” making that the highest possible and the expiry about four days
( to be sure that we have enough time to debug ). - Click ” Submit “.
- You’ll now have a temporary account. Please provide us here in the private section the URL, so we can login and help you out.
When your issue is fixed, you can always remove the plugin!
If you prefer to not use the plugin, you can manually create an admin user and post the login credentials in the “private data” field.Best regards,
NikkoOctober 21, 2020 at 7:25 pm #1254761Hi Nikko,
Thank you so much for taking a look at the issue!
Best,
Alexander- This reply was modified 4 years ago by Nikko. Reason: security
October 23, 2020 at 8:02 am #1255171Hi Alexander,
Thanks for giving us admin access.
This is now fixed, the only difference was the background image in the Color Section.
The one you gave that has does have an issue doesn’t have a background image to it.Best regards,
NikkoOctober 25, 2020 at 2:26 am #1255443Hi Nikko,
Icant find a way to create another thread but I have yet another issue with the website which I can’t wrap my head around
Everything works fine until I go to the website using a mobile device (tried an iPad and an Android phone). When I try to change the language it simply reloads the current one without going to the needed language.
Hope to hear from you!
Best,
AlexanderOctober 25, 2020 at 11:14 pm #1255532.
- This reply was modified 4 years ago by Alex PS.
October 25, 2020 at 11:45 pm #1255549Hi,
Did you need additional help with this topic or shall we close?
Best regards,
Jordan ShannonOctober 26, 2020 at 5:47 am #1255611Hi Jordan,
I guess you can close the topic. Although I have said that I will torn off WPML I am still hesitant to build another language as a separate wordpress installation. Would you please still look at what could have caused the language switch problem?
If not you can close the thread. Thank you for taking the time to answer and sorry for inconvenience.
Alexander
October 26, 2020 at 3:31 pm #1255736Hi Alexander,
We would like to request you to create a new thread so this thread won’t get too long with multiple topics.
We’ll be closing this thread and continue our conversation on a separate thread.Best regards,
Nikko -
AuthorPosts
- The topic ‘Link logo to another website’ is closed to new replies.