Forum Replies Created
-
Author
-
arbolifeParticipant
Hi,
You can ignore request #1, it’s connected with my caching plugin. Will solve it on my own.
However, I still need to solve this one:
I changed the “lost password” link in the login error message (code above) to use the Kleo modal pop-up but it doesn’t work. My link looks like the other one with this:
<a href="#kleo-lostpass-modal" class="kleo-show-lostpass kleo-other-action">
but clicking on it has no effect instead of switching to the kleo ajax lost password form. How to I make this link also switch. You can try if you try the ajax login from anywhere except the homepage and try to login with bogus information. Then the link shows up but doesn’t work.Thanks,
MarcarbolifeParticipantHi Radu,
Great, thanks. I made a lot of progress with this. I can now customize the message and translate it with a filter in my child theme [by the way, the only way to detect language is through the referring URL as both get_locale() and ICL_LANGUAGE_CODE always bring the default site language].
Here’s the code if it can help someone:
COPY CODEadd_filter('login_errors','login_error_message'); function login_error_message($error){ //check if that's the error you are looking for with the search string $pos = strpos($error, 'paramètres invalides'); if (is_int($pos)) { $refer_url = explode('/', wp_get_referer() ); $refer_lang = $refer_url[3]; if ( strpos($refer_lang, 'en') !== false ) { $error = '<strong>ERROR</strong>: Invalid username. <a href="#kleo-lostpass-modal" class="kleo-show-lostpass kleo-other-action">Lost your password?</a>'; } elseif ( strpos($refer_lang, 'fr') !== false ) { $error = '<strong>ERREUR</strong>: paramètres invalides. <a href="#kleo-lostpass-modal" class="kleo-show-lostpass kleo-other-action">Mot de passe oublié ?</a>'; } } return $error; }
Now I have 2 more issues with the kleo ajax login pop-up mechanism:
1. I set WPML to have show /fr/ in French and /en/ in English. I also switched the default language to French. Now the ajax login pop-up works everywhere on the site except from the home page. So If you go to https://www.arbolife.com/en/ and click on the login icon (top right), it opens wp-login.php which I want to avoid (can’t be translated). From any other page on the site, the kleo ajax pop-up works fine.
2. I changed the “lost password” link in the login error message (code above) to use the Kleo modal pop-up but it doesn’t work. My link looks like the other one with this:
<a href="#kleo-lostpass-modal" class="kleo-show-lostpass kleo-other-action">
but clicking on it has no effect instead of switching to the kleo ajax lost password form. How to I make this link also switch. You can try if you try the ajax login from anywhere except the homepage and try to login with bogus information. Then the link shows up but doesn’t workCheers,
MarcarbolifeParticipantHi Radu,
Actually it is a theme thing.
I tested those filters again and they work for wp-login. Where they don’t work is for Kleo’s ajax login pop-up which is multilingual. What I need is for the error message of this pop-up to also be multilingual.If you guys don’t want to put it in the theme, that’s ok, I can customize function kleo_ajax_login() in my child theme. It’s just that every attempt I made a detecting the language from WPML or as you suggested with
if( get_locale() == ‘en_EN’ ) {}
didn’t work and the error message always come back in English.Best,
MarcarbolifeParticipantHi Radu,
This doesn’t work either.
I tried the most trivial test (from the code you suggested) and it doesn’t work:
COPY CODEadd_filter('login_errors','login_error_message'); function login_error_message($error){ $error = "Test error message"; return $error; }
Cheers,
MarcarbolifeParticipantHi Radu,
So I tried 2 versions and still no success:
First with trying your suggestion, heres my code:
COPY CODEif ( is_wp_error( $user_signon ) ) { $error_msg = $user_signon->get_error_message(); if( get_locale() == 'fr_FR' ) { $error_msg = '<strong>ERREUR</strong>: Utilisateur ou mot de passe invalide.'; } echo wp_json_encode( array( 'loggedin' => false, 'message' => '<span class="wrong-response"><i class="icon icon-attention"></i> ' . $error_msg . '</span>', ) ); //echo json_encode(array( 'loggedin' => false, 'message' => '<span class="wrong-response"><i class="icon icon-attention"></i> ' . __( 'Wrong username or password. Please try again.', 'kleo_framework' ) . '</span>' ));
No success, it stays in English.
Second attempt is with the old code from your function and WPML string translation:
echo json_encode(array( 'loggedin' => false, 'message' => '<span class="wrong-response"><i class="icon icon-attention"></i> ' . __( 'Wrong username or password. Please try again.', 'kleo_framework' ) . '</span>' ));
I found the exact string in WPML string translation, translated it… and still no success. The message stays in English no matter what I do.
What else do you suggest I try?
Cheers,
MarcMarch 20, 2017 at 23:14 in reply to: Change amount to scroll before transparent menu transition #156157arbolifeParticipantHi Radu,
Installing 4.2 fixed the problem. Thanks for keeping at it.
Cheers,
MarcarbolifeParticipantNo problem, I’m only a few months ahead of you. I’m sure you’ll enjoy the learning.
Cheers,
MarcarbolifeParticipantMiguel,
If you are you a coder and know how to make setting pages for a plugin, we could discuss a possible collaboration. The limitations with my code right now are:
– It has never been installed on a fresh kleo + GD install (I don’t know what part would work or not work)
– It assumes that GD premium plugins are activated and running – it should check and functions should be disabled if plugins are missing.
– It assumes a bunch of settings in GeoDirectory (like how slugs are formed) – it should be checked and functions should be disabled if the wrong settings are present.
– It lacks a settings page, it’s all in the code.Let me know what you think.
Best,
MarcarbolifeParticipantHi @migued,
Thanks for your message. Same thing for me: I didn’t like the Kleo design for GeoDirectory, loved the GD Supreme child theme version, and wanted to keep Kleo as my theme because of all its other features that Supreme GD lacks. So I took the Supreme GD child theme code, through it into a plugin and started customizing it with php and a lot of CSS until it looked and behaved like I wanted it to. The Supreme code is untouched and can be upgraded inside my plugin.
Best,
MarcMarch 2, 2017 at 00:21 in reply to: Testimonials not showing 1 item at a time in carousel mode #154543arbolifeParticipantHi Radu,
Thanks for your help, in troubleshooting I found it’s connected to my child theme and then I found a CSS string that was causing this issue. Sorry for troubling you with this as it was all on my end.
Cheers,
MarcarbolifeParticipantI couldn’t get any of it to work. I tried the filter you recommended with no effect.
I tried customizing your theme’s function in my child theme and the 2 WPML tricks I know don’t work:
1.$error_msg = __( 'Wrong username or password. Please try again.', 'kleo_framework' );
–> I translate it with WPML string editor but it has no effect on the French site
2. `if (ICL_LANGUAGE_CODE==’fr’) {
$error_msg = ‘Mauvais utilisateur ou mot de passe’;
}`
–> Looks like the if test is never true, even when on the French site.I’m at a loss.
Cheers,
MarcarbolifeParticipantHi Radu,
It seems like you guys had it right for translation but then commented the code out to put something that can’t be translated easily.
in functions.php on line 1408:
COPY CODEecho wp_json_encode( array( 'loggedin' => false, 'message' => '<span class="wrong-response"><i class="icon icon-attention"></i> ' . $error_msg . '</span>', ) ); //echo json_encode(array( 'loggedin' => false, 'message' => '<span class="wrong-response"><i class="icon icon-attention"></i> ' . __( 'Wrong username or password. Please try again.', 'kleo_framework' ) . '</span>' ));
If I comment the first part and uncomment the second part, it works and can be translated. If this is intended to stay like this, could you guys add a filter there so the content of $error_msg could be easily customized?
Cheers,
MarcFebruary 28, 2017 at 19:40 in reply to: Testimonials not showing 1 item at a time in carousel mode #154407arbolifeParticipantHi Radu,
Thanks, but the problem is not that I’m missing a third testimonial to display. The problem is that I want to display only 1 at a time and that used to work in a previous version. Check out my settings, they are clearly set to display a minimum of 1 and a maximum of 1 testimonial, yet there are 2 showing.
When it worked, there was only one showing and it was centered with the carousel setting to switch between them. I haven’t made any changes to the shortcodes, but now it doesn’t work.
See my setting in the picture attached.
Cheers,
MarcAttachments:
You must be logged in to view attached files.February 28, 2017 at 19:23 in reply to: Change amount to scroll before transparent menu transition #154405arbolifeParticipantThis reply has been set as private.February 28, 2017 at 19:21 in reply to: Change amount to scroll before transparent menu transition #154402arbolifeParticipantThis reply has been set as private.February 25, 2017 at 01:12 in reply to: Change amount to scroll before transparent menu transition #154150arbolifeParticipantHi Radu,
I did copy the files over and I don’t see much of a difference.
Even when I set the value to 0 or 1 I have to scroll 200+ pixels before the background gets dark. I tried negative values, but they screw up the animation of the menu.Can you please take a look at the test site I sent you a private link earlier? I made the change to the JS files and it still doesn’t have an impact (I disabled caching, so changes should work instantly).
Thanks,
MarcarbolifeParticipantHi Radu,
Thanks, it works only when I put priority 9 instead of 11. Does that make sense?
COPY CODEfunction sq7_rdu_redirect( $redirect_to, $request, $user ) { $redirect_to = get_permalink(); return $redirect_to; } add_filter('login_redirect', 'sq7_rdu_redirect', 9, 3);
Best,
MarcarbolifeParticipantHi Radu,
True, it makes sense… but from a usability perspective why would I want to define a redirect for Facebook only and not for a user using a password ?
I don’t mind coding this in my child theme, could you please elaborate on how this line would look like to reload the current page (below the popup):
$redirect_to = '/my-route-after-redirect/';
Thanks,
MarcFebruary 23, 2017 at 23:48 in reply to: Testimonials not showing 1 item at a time in carousel mode #154070arbolifeParticipantThis reply has been set as private.February 23, 2017 at 23:25 in reply to: Change amount to scroll before transparent menu transition #154068arbolifeParticipantThis reply has been set as private.February 12, 2017 at 22:09 in reply to: Change amount to scroll before transparent menu transition #152757arbolifeParticipantHi Radu,
I tested again and there is an effect after all. (I updated a bunch of plugins in between).
The value affects the resizing of the menu, but the dark background still only appears after the transition is finished. It can’t be made short enough, because small or negative values reduce the initial size of the menu bar, or completely kill the transition with the menu already being small (which is not the intention).
I don’t want to change the timing or speed of the change in size of the menu, I like the default effect. The only setting I need is to have the dark background appear much earlier, even if the transition is not finished yet.
Cheers,
MarcFebruary 9, 2017 at 15:51 in reply to: Change amount to scroll before transparent menu transition #152474arbolifeParticipantHi Radu,
In installed 4.1.8 and played with the Resize Offset and I see no effect on the menu. I tried with 0, 1, 10, 100, 500 and I see no effect what so ever. What am I doing wrong ?
My current setting is 10. You can see that is has no effect on the resizing, nor on the darkening which is the behaviour I’m need to alter. Here is an example: https://www.arbolife.com/directory/
Cheers,
MarcFebruary 6, 2017 at 01:42 in reply to: Change amount to scroll before transparent menu transition #152028arbolifeParticipantHi Radu,
Great, thank you. Can you please let me know where I can download the update ? All I can find is 4.1.7.
Cheers,
MarcFebruary 2, 2017 at 22:21 in reply to: Change amount to scroll before transparent menu transition #151759arbolifeParticipantOK, thanks Radu. Keep me posted.
Best,
MarcFebruary 1, 2017 at 22:07 in reply to: Change amount to scroll before transparent menu transition #151637arbolifeParticipantThis reply has been set as private.January 24, 2017 at 00:43 in reply to: Change amount to scroll before transparent menu transition #150556arbolifeParticipantHi Radu,
We’ll be going live this week, so now it’s starting to become a pressing issue. Can you please look into this?
Cheers,
MarcJanuary 11, 2017 at 23:02 in reply to: Change amount to scroll before transparent menu transition #149497arbolifeParticipantHi Radu,
Thanks for getting back to me. No problem, there is no rush. I have another 10 days or so before going live with the area of the site where this is a problem.
Cheers,
MarcJanuary 10, 2017 at 21:47 in reply to: Change amount to scroll before transparent menu transition #149399arbolifeParticipantHi Radu,
I made the changes you suggested, minified the file and uploaded it and the app.min.js to the server. It makes no difference whether the value in the parentheses is empty, 1, or 30. The dark background of the the menu only appears after more than 200 pixels of scrolling. I’d like it to appear 40 or 50px.
I noticed the settings you suggested altering are about the logo resize. I’m happy with how that works. I only want to bring in the dark background earlier in the scrolling.
Cheers,
MarcJanuary 9, 2017 at 03:01 in reply to: Need to keep a small menu on a page with PHP action hook or CSS #149222arbolifeParticipantHi Radu,
Thank you, this worked perfectly well.
Cheers,
MarcJanuary 5, 2017 at 04:43 in reply to: Need to keep a small menu on a page with PHP action hook or CSS #148843arbolifeParticipantThis reply has been set as private.January 2, 2017 at 11:29 in reply to: Testimonials not showing 1 item at a time in carousel mode #148515arbolifeParticipantThis reply has been set as private.arbolifeParticipantI found the solution, it was linked with WPML. The space was missing in the translation of the separator.
Happy holidays!
MarcarbolifeParticipantHi Laura,
Great, I forgot it was there. I have one more question, the categories get separated by a comma but there is no space after the comma: Durabilité,Produits ménagers
(example: https://www.arbolife.com/fr/blog/lessives-fait-maison/)How can I add a space after the comma?
Best,
MarcarbolifeParticipantIt’s not even “basic” as the tag disappears as well. Are you guys planning to fix this in an upcoming release or is there some hack I can apply from my end?
Cheers,
MarcarbolifeParticipantHi Abe,
I’ve updated my code, but the disappears which defeats the entire purpose. Here’s my new code, still not working:
COPY CODE<p style="text-align: center;"><strong>© [current-year] ArboLife Ltd liab. Co | Neuchâtel | Switzerland | <a href="https://www.facebook.com/arbolifecom" target="_blank"><span style="color:#b2b8c0"><i class="icon-facebook-1"></i></span></a> | <a href="https://www.linkedin.com/company/arbolife" target="_blank"><span style="color:#b2b8c0"><i class="icon-linkedin-1"></i></span></a> | <a href="https://twitter.com/arbo_life" target="_blank"><span style="color:#b2b8c0"><i class="icon-twitter-1"></i></span></a></strong></p>
Best,
MarcOctober 20, 2016 at 20:59 in reply to: Reset password link from wp-login to 404 (possibly linked with 4.1.3) #140585arbolifeParticipantGlad it worked for you too. Cheers
arbolifeParticipantHi Radu,
I tried the setting in php.ini and it made no difference. I can reproduce this issue on my live and test installation. Here are the steps, maybe clearer than the first time.
1. Go to Theme Options -> General
2. In the Footer Text, switch the editor view from “Visual” to “Text”
3. Enter this content:
<p style="text-align: center;"><strong>© [current-year] ArboLife Ltd liab. Co | Neuchâtel | Switzerland | <a href="https://www.facebook.com/arbolifecom" target="_blank"><font color="#b2b8c0"><i class="icon-facebook-1"></i></font></a> | <a href="https://www.linkedin.com/company/arbolife" target="_blank"><font color="#b2b8c0"><i class="icon-linkedin-1"></i></font></a> | <a href="https://twitter.com/arbo_life" target="_blank"><font color="#b2b8c0"><i class="icon-twitter-1"></i></font></a></strong></p>
4. Already there you can reproduce the issue immediately, if you switch the editor view from “Text” back to “Visual”, it doesn’t display the content properly and if you then switch it again from “Visual” to “Text” the and <font> tags are gone and your left with this code:
<p style="text-align: center;"><strong>© [current-year] ArboLife Ltd liab. Co | Neuchâtel | Switzerland | <i class="icon-facebook-1"></i> | <i class="icon-linkedin-1"></i> | <i class="icon-twitter-1"></i></strong></p>
5. OK, say you don’t play with the editor view and put the right content in “Text” mode and save, then it will appear fine on the site.
6. If you go back into theme settings it will stay ok in there for some time, but if you start making changes to other theme options several days or weeks later, the editor will switch back to “Visual” and you’ll be stuck with the issue as described in point 4.Can you reproduce any of this? At least point 4 where the problem happens in front of your eyes should be easy to reproduce.
Let me know.
Cheers,
Marc -
AuthorPosts