Forum Replies Created

Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
  •  arbolife
    Participant

    Hi Radu,

    I tried to put this code as it is in my functions.php file and it generates an HTTP error 500.

    COPY CODE
    <img src=”
    if ( ! function_exists( ‘kleo_fb_bp_show_avatar_url’ ) ) {
    function kleo_fb_bp_show_avatar_url($gravatar, $params)
    {
    
    //if we have an avatar uploaded and is not Gravatar return it
    if (strpos($gravatar, home_url()) !== false && strpos($gravatar, ‘gravatar’) === false) {
    return $gravatar;
    }
    
    return $gravatar;
    }
    }”>

    Cheers,
    Marc

    in reply to: Testimonials show quotes instead of image #160505
     arbolife
    Participant

    Hi Radu,

    The IP was blocked only for 24 hours because it generated 10x 404 errors in 30 seconds. It has now been put on whitelist.

    Maybe don’t deactivate the Cloudinary plugin, otherwise all images hosted in the cloud generate 404 errors:

    COPY CODE
    86.127.153.187 - - [28/Apr/2017:15:56:44 +0200] "GET /wp-content/uploads/https:/res.cloudinary.com/arbolife/image/upload/v1481389384/clients/ArboLife-client-logo-graine-de-belette.png HTTP/1.1" 404 8565 - ww1.arbolife.com
    86.127.153.187 - - [28/Apr/2017:15:56:45 +0200] "GET /wp-content/uploads/https:/res.cloudinary.com/arbolife/image/upload/v1481389384/clients/ArboLife-client-logo-zero-waste-switzerland.png HTTP/1.1" 404 8567 - ww1.arbolife.com
    86.127.153.187 - - [28/Apr/2017:15:56:45 +0200] "GET /wp-content/uploads/https:/res.cloudinary.com/arbolife/image/upload/v1481389384/clients/ArboLife-client-logo-oka.png HTTP/1.1" 404 8555 - ww1.arbolife.com

    You can continue troubleshooting now. I had already tried disabling all plugins, it’s really only connected to WPML.

    Cheers,
    Marc

    in reply to: Translate login error messages #156836
     arbolife
    Participant

    Hi 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 CODE
    add_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 work

    Cheers,
    Marc

    in reply to: Translate login error messages #156272
     arbolife
    Participant

    Hi Radu,

    This doesn’t work either.

    I tried the most trivial test (from the code you suggested) and it doesn’t work:

    COPY CODE
    add_filter('login_errors','login_error_message');
    function login_error_message($error){
        $error = "Test error message";
        return $error;
    }

    Cheers,
    Marc

    in reply to: Translate login error messages #156165
     arbolife
    Participant

    Hi Radu,

    So I tried 2 versions and still no success:

    First with trying your suggestion, heres my code:

    COPY CODE
    if ( 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,
    Marc

    in reply to: Translate login error messages #154434
     arbolife
    Participant

    Hi 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 CODE
    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>' ));

    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,
    Marc

    in reply to: Wrong redirect after pop-up login #154145
     arbolife
    Participant

    Hi Radu,

    Thanks, it works only when I put priority 9 instead of 11. Does that make sense?

    COPY CODE
    function sq7_rdu_redirect( $redirect_to, $request, $user ) {
        $redirect_to = get_permalink();
        return $redirect_to;
    }
    add_filter('login_redirect', 'sq7_rdu_redirect', 9, 3);

    Best,
    Marc

    in reply to: Footer text gets changed on its own #140996
     arbolife
    Participant
    in reply to: Facebook Registration redirect to original page #135927
     arbolife
    Participant

    Hi Radu,

    Thanks, but that produces the same result as the first two attempts, it creates a 404 error because there is again “/false” appended to the current page URL.

    I googled it realized the get_permalink(); was returning the false and your function was appending it to the end of the current page URL, so no need to get the current URL because it’s already there. Not adding anything to it might work. So I tried this – and I’m not a coder, but it worked:

    COPY CODE
    add_filter('kleo_fb_register_redirect','custom_redirect_link_facebook_login');
    function custom_redirect_link_facebook_login(){
        $reloadcurrentpage = "";
        return $reloadcurrentpage;
    }
    add_filter('kleo_fb_register_redirect','custom_redirect_link_facebook_login');

    Is this completely stupid to create a function to return nothing or should it do something else?

    Cheers,
    Marc

    in reply to: Transparent mobile menu + menu icon #133299
     arbolife
    Participant

    I have one more issue with this code, so let me summarize it all in this post for you.

    What I want: when menu is set to transparent -> the mobile menu is also transparent.
    The code you provided works fine for achieving it, but it has 2 side effects:

    1. The title and breadcrumb area disappearing below a certain browser size (1024px or so)

    2. It makes the whole page get hidden behind the mobile menu (removes padding) when a non-transparent mobile menu is being used.

    COPY CODE
    
    @media(max-width:1024px) {
    .navbar {
        background:rgba(42, 42, 42, 0.0) !important;
        position: absolute;
    }
    }

    Can you please suggest another fix that doesn’t break the other things ?

    Cheers,
    Marc

    in reply to: Transparent mobile menu + menu icon #133290
     arbolife
    Participant

    Hi,

    OK, so I fixed the weird icons by adding this to the quick CSS:

    COPY CODE
    .icon-bar:before {
        content: '' !important;
    }

    I don’t know why it was there in the first place 😉

    However, the title and breadcrumb disappearing is really bad, I hope you can help me fix that one.

    Thanks,
    Marc

    in reply to: Transparent mobile menu + menu icon #133274
     arbolife
    Participant

    Hi Radu,

    Sorry, I need to reopen this thread.

    There is a side-effect of the code you provided is that the title + breadcrumb area disappear below a certain browser size:

    COPY CODE
    @media(max-width:1024px) {
    .navbar {
        background:rgba(42, 42, 42, 0.0) !important;
        position: absolute;
    }
    }

    Can you please provide an update that doesn’t create this problem?

    The other problem that was solved in this ticket was the 3 arrows on top of each others right below the mobile menu. I solved it as you recommended by doing another clean download of new icons. The problem is now back, but I have not touched the icon files since fixing it.

    You can check it out yourself. Here’s a simple page that has both problems, the title and breadcrumbs + the weird icons: https://www.arbolife.com/events-home/events-attending/

    Cheers,
    Marc

    in reply to: Post Categories on Grid built with Visual Composer #131525
     arbolife
    Participant
    This reply has been set as private.
    in reply to: Post Categories on Grid built with Visual Composer #131414
     arbolife
    Participant
    This reply has been set as private.
    in reply to: BP profile detection and change in icos #131412
     arbolife
    Participant
    Not marked as solution
    in reply to: Post Categories on Grid built with Visual Composer #131276
     arbolife
    Participant

    OK I tried just that and it’s a complete failure. I get an HTTP error 500 in return.

    Here’s my archive.php file in the kleo child theme:

    COPY CODE
    <?php
    /**
     * The template for displaying Archive pages
     *
     * Used to display archive-type pages if nothing more specific matches a query.
     * For example, puts together date-based pages if no date.php file exists.
     *
     * If you'd like to further customize these archive views, you may create a
     * new template file for each specific one. For example, Twenty Fourteen
     * already has tag.php for Tag archives, category.php for Category archives,
     * and author.php for Author archives.
     *
     * @link http://codex.wordpress.org/Template_Hierarchy
     *
     * @package WordPress
     * @subpackage Kleo
     * @since Kleo 1.0
     */
    
    get_header(); ?>
    
    <?php
    //Specific class for post listing */
    $blog_type = sq_option('blog_type','masonry');
    $blog_type = apply_filters( 'kleo_blog_type', $blog_type );
    
    $template_classes = $blog_type . '-listing';
    if ( sq_option( 'blog_archive_meta', 1 ) == 1 ) {
        $template_classes .= ' with-meta';
    } else {
        $template_classes .= ' no-meta';
    }
    
    if ( $blog_type == 'standard' && sq_option('blog_standard_meta', 'left' ) == 'inline' ) {
        $template_classes .= ' inline-meta';
    }
    add_filter('kleo_main_template_classes', create_function('$cls','$cls .=" posts-listing ' . $template_classes . '"; return $cls;'));
    ?>
    
    <?php get_template_part('page-parts/general-title-section'); ?>
    
    <?php get_template_part('page-parts/general-before-wrap'); ?>
    
    <?php if ( category_description() ) : ?>
        <div class="archive-description"><?php echo category_description(); ?></div>
    <?php endif; ?>
    
    <?php if ( have_posts() ) : ?>
    
        echo do_shortcode( '[vc_row][vc_column][vc_masonry_grid post_type="post" max_items="-1" style="lazy" items_per_page="8" show_filter="yes" gap="15" filter_style="bordered-rounded" item="8865" grid_id="vc_gid:1470176247276-98a2a59c-ab45-5" filter_source="category"][/vc_column][/vc_row]' );
    
    else :
        // If no content, include the "No posts found" template.
        get_template_part( 'content', 'none' );
    
    endif;
    ?>
    
    <?php get_template_part('page-parts/general-after-wrap'); ?>
    
    <?php get_footer(); ?>
    
    in reply to: Menu issue with WPML #131002
     arbolife
    Participant
    Not marked as solution
Viewing 17 posts - 1 through 17 (of 17 total)

Log in with your credentials

Forgot your details?