Home › Forums › Legacy Support › Support queries › Translation issues › Logo link issue with WPML
- This topic has 16 replies, 4 voices, and was last updated 8 years, 6 months ago by soulshakepower.
-
AuthorPosts
-
May 1, 2016 at 10:52 am #45745soulshakepowerSpectatorHi, I need the logo link in the header to point to the home page in the user's language, and currently it always goes to the default language. I tried the code in this post: https://wplms.io/support/knowledge-base/wpml-compatible-link-on-logo/ But the code doesn't work, I got an error that's says: unexpected 'wpml_site_link' (T_STRING) in your code on line 2 Therefore I can't use it, can you check it out please :-) Thanks!May 3, 2016 at 10:52 am #46143H.K. LatiyanParticipantThere were some html formating in the code, I have updated the code please delete the previous code and copy the code from the tip again and then check.May 3, 2016 at 11:45 am #46164soulshakepowerSpectatorHey great!! Worked like a charm, put the resolve stamp :-) Cheers!May 3, 2016 at 9:02 pm #46274soulshakepowerSpectatorAaarg, actually since I putted your code nobody was able to login to the site!! Note: My user are not redirected anywhere after login (usually stay on the same page they were). Please work your magic again, it's quite there and very key to me! Thanks!May 5, 2016 at 12:35 am #46520soulshakepowerSpectatorI tried the code from wpml (https://wpml.org/wpml-hook/wpml_home_url/) and replaced in the header-transparent.php- the logo link with it... without success.... It was working with your code, "only" signing in was not working: people would type their credentials and get redirected to home page without being logged after pressing sign in. I think you are very close! Hey I've launched my website, check it out when you got a chance :-) harp-school.com I'm very happy with the theme and what it permitted me to achieve! Greeting to all WPLMS team!May 5, 2016 at 11:01 am #46619Anshuman SahuKeymasterPlease try adding the given code in your wplms-customizer.php file at the end before " ?> " in wplms customizer plugin : add_filter('wplms_login_widget_action','login_widget_fix'); function login_widget_fix(){ if (is_multisite()) { //return network_site_url($url); $link = home_url($url); } else { $link = site_url($url); } return apply_filters('wplms_site_link',$link.'/wp-login.php'); } Lemme know if this helps .May 5, 2016 at 1:48 pm #46668soulshakepowerSpectatorHi Alex, Thanks for quick reply. The code only works if I use the /wp-login page to login. But users login using the buddypress page and on these it doesn't work. I use the "popup" style and after login I'm back to where I was without being logged. Is there a way to apply your code to the other login styles? Thanks!!May 7, 2016 at 11:26 am #46981Anshuman SahuKeymasterWell i was not able to find any issue with the login in your site when i checked itfrom the login popup . Can you please share more information on which page it is not working and share steps to replicate this ?May 7, 2016 at 11:53 am #46985soulshakepowerSpectatorHi, thanks. There is no login issue now cause I disabled the logo link code fix. I'm gonna deploy a development version of my site (didn't had time yet, the website launch took all my time). So I will send you the link and this way yoy will be able to see that once I put the code fix, when we put our credentials in any of the login styles and press sign in, nothing happens. Thanks for being on it! To be continued...May 9, 2016 at 11:47 am #47187Anshuman SahuKeymasterSure ..May 27, 2016 at 4:48 pm #50621soulshakepowerSpectatorHi Alex, My dev website in now up: http://marti.world/sites/harpschool I putted your above code, now you should be able to see that the login function doesn't work anymore. Even if I type a non-existing id or password, nothing happens. Your credentials are the same as for my live version: user: wplms pass: Tjcn6mWB@p$lAmv4e2W%np(x Thanks for your help on this! PS. <span style="line-height: 1.5;">Sorry this site will be slower than the live one since I don't have the same CDN level.</span>May 28, 2016 at 11:32 am #50750Anshuman SahuKeymasterAdded the code given below code in your wplms-customizer.php file to fix the login widget and logo url . Note : i have added the code already in your site .There's not need to add it again . please check and confirm . add_filter('wplms_site_link','make_it_compatible_wpml122355'); function make_it_compatible_wpml122355($link){ return apply_filters('wpml_home_url',$link); } add_filter('wplms_login_widget_action','login_widget_fixzzzzzz',999999); function login_widget_fixzzzzzz($url){ return 'http://your-site.com/wp-login.php'; }May 29, 2016 at 10:40 am #50798soulshakepowerSpectatorHi, Thanks for your quick reply. Getting closer! Now people can log in BUT: - Users are redirected to the default language after login... i.e: if someone logs in from a french page, he gets redirected to the english website after login :-/ - User are redirected to the home page after login, while I want them to be redirected to the same page they were. (This is how I set thing in WPLMS options and I wish to keep it that way so people don't get confused). Note: I use the "functionality" plugin, so to edit my functions.php file it is in the PLUGINS > "Edit functions" menu. Now I have the old code in my functions.php + your new one in wplms customizer. Could you clarify which one I should keep so when I will duplicate it to my live website it will be less confusing. Thanks so much & have a nice sunday!May 30, 2016 at 11:51 am #50929MrVibeKeymasterTip updated , please try the tip again. Let us know if it does not work.May 30, 2016 at 11:56 pm #51003soulshakepowerSpectatorHey it works!! Thank you so much!!! If you want to learn the harp, we'll be happy to offer you access to our courses, hi hi! Good job on that one. Will you add this to the future updates or no? Cheers from sunny south of France :-)
-
AuthorPosts
- The topic ‘Logo link issue with WPML’ is closed to new replies.