As far I know (google power), I need to add qtrans_getLanguage(); in search button like this <button class="search" type="submit" id="searchsubmit" input type="hidden" name="lang" value="<?php echo qtrans_getLanguage(); ?>">{$label}</button> but this isn’t working. Any ideas why?
Still – search don`t work + I need qtranslate-slug plugin, because with ztranslate all pasts jumps to default language.
Hi, try something like this:
<input type="hidden" name="lang" value="<?php echo qtrans_getLanguage(); ?>">
<button class="search" type="submit" id="searchsubmit" >{$label}</button>
A example, searchform.php;
<form method="get" id="searchform" class="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>" role="search">
<input type="search" class="field" name="s" value="<?php echo esc_attr( get_search_query() ); ?>" id="s" placeholder="<?php echo esc_attr_x( 'Search …', 'placeholder', 'theme' ); ?>" />
<input type="hidden" name="lang" value="<?php if (function_exists('qtrans_getLanguage')) { echo qtrans_getLanguage();} else { if (function_exists('ztrans_getLanguage')) { echo ztrans_getLanguage();} } ?>">
<button type="submit" class="submit" id="searchsubmit"><i class="icon-search"></i></button>
</form>
Good idea, but still
sappy.lv/?s=&purpose=sale&search=1&post_type=estate&location=nica&price_from=&price_to=&term=&lang=<%3Fphp+echo+qtrans_getLanguage()%3B+%3F>
Review why the code is being taken as a string and not a php code to execute.