Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • I am facing a similar problem, and I’m not using Elementor. When using the WP Search block, results switch to the default language.

    The team from GeneratePress kindly helped me find a workaround. I post their solution here in case somebody else needs it.

    They suggested creating a new search form shortcode adding this PHP snippet:

    add_shortcode( ‘search_form’, function() {
    ob_start();

    ?>
    <form role=”search” method=”get” class=”search-form” action=”<?php echo home_url() . ‘/’ . pll_current_language(); ?>”>
    <label>
    <span class=”screen-reader-text”><?php echo _x( ‘Search for:’, ‘label’ ) ?></span>
    <input type=”search” class=”search-field”
    placeholder=”<?php echo esc_attr_x( ‘Search …’, ‘placeholder’ ) ?>”
    value=”<?php echo get_search_query() ?>” name=”s”
    title=”<?php echo esc_attr_x( ‘Search for:’, ‘label’ ) ?>” />
    </label>
    <input type=”submit” class=”search-submit”
    value=”<?php echo esc_attr_x( ‘Search’, ‘submit button’ ) ?>” />
    </form>

    <?php

    return ob_get_clean();
    } );`

    Then you can insert this shortcode to generate a search widget: [search_form]

    It worked for me. I hope it helps you too. ??

    Thread Starter Leo Kalnay

    (@kalnaywp)

    In case someone else faces the same problem, I detail below how it is solved. The solution lies is in the Elementor settings.

    1) In Elementor > Settings > General, uncheck “Disable Global Colors” and “Disable Global Fonts” boxes.

    2) Then go to Elementor > Settings > Advanced > CSS Print Method and select the “Internal Embedding” option.

    3) Finally, go to Elementor > Tools > General > Regenerate CSS, and click on “Regenerate Files”.

    Don’t forget to clear the browser cache to see the result. ??

    Thread Starter Leo Kalnay

    (@kalnaywp)

    Hello again,

    The problem is still there from almost a week ago, and I can’t find a solution.

    The last thing I’ve tried was editing the wp-config.php and setting the value of WP-DEBUG to true (as @arielk-1 suggests in his welcome message), but it didn’t work either.

    I’ve also tried all the other recommendations, without any success.

    I’m feeling quite lost. If you’ve got an idea about how I could solve this problem, and you want to share it with me, I’d really appreciate it! My site looks horrible. ??

    Thanks!

    • This reply was modified 7 years, 7 months ago by Leo Kalnay.
Viewing 3 replies - 1 through 3 (of 3 total)