Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1347684
    s_gogos
    Participant

    Hello there,

    Could you please help me on this?
    I tried to find the solution myself but I’m afraid I can’t 🙁

    My website (www.worldvespa.net) is – kind of – translated into two languages.
    English is the primary and then I added Greek as my second language using “Polylang” plugin.
    The problem is that the search button on the upper menu doesn’t give any results in Greek.
    In English it works perfectly but in Greek it says that the page doesn’t exist.

    Can you help me modify the search button, to make it work for the second language, too?

    Thank you in advance,
    Stergios (www.worldvespa.net)

    #1347685
    s_gogos
    Participant
    This reply has been marked as private.
    #1348273
    Rad
    Moderator

    Hi there,

    Thanks for posting in.

    Please add this code to your child theme’s functions.php

      function x_navbar_searchform_overlay() {
    
        if ( x_get_option( 'x_header_search_enable' ) == '1' ) :
            
            $search_slug = '';
    
        	switch ( get_locale() ) {
        		case 'el':
        			$search_slug = '/αρχική/';
        			break;
       	    }
          ?>
    
          <div class="x-searchform-overlay">
            <div class="x-searchform-overlay-inner">
              <div class="x-container max width">
                <form method="get" id="searchform" class="form-search center-text" action="<?php echo esc_url( home_url( $search_slug ) ); ?>">
                  <label for="s" class="cfc-h-tx tt-upper"><?php _e( 'Type and Press &ldquo;enter&rdquo; to Search', '__x__' ); ?></label>
                  <input type="text" id="s" class="search-query cfc-h-tx center-text tt-upper" name="s">
                </form>
              </div>
            </div>
          </div>
    
          <?php
    
        endif;
    
      }
      add_action( 'x_before_site_end', 'x_navbar_searchform_overlay' );

    I doubt this will work, the problem is related to redirection. Whenever I tried adding URL parameter, it redirects to the home page. Would you mind providing your FTP login credentials as well?

    Thanks!

    #1348930
    s_gogos
    Participant
    This reply has been marked as private.
    #1349267
    Rad
    Moderator
    This reply has been marked as private.
    #1349657
    s_gogos
    Participant

    Never mind, probably it has to do with “Polylang” plugin.
    Could you please undo what you did?
    Thanks for your time!

    #1349659
    s_gogos
    Participant

    Oh, I think it’s fine, I purged all the caches and looks like everything works fine… 🙂 (except for the search)
    Thanks for your help.
    I’ll contact the “Polylang” guys.

    #1349678
    Thai
    Moderator

    Let us know how it goes!

  • <script> jQuery(function($){ $("#no-reply-1347684 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>