Plugin Author
Chouby
(@chouby)
a loop (search symbol) has disappeared from the translated versions of my website
Sorry, but that’s not clear to me. Could you provide a link for better understanding?
Never happened with previous versions
Which version?
Thread Starter
ian6
(@ian6)
Thanks for your fast reaction π
– At the site header, there’s a search widget with a search-field and on the right a ‘search.png’ with “submit” functionality.
If the .png doesn’t appear, normally there’s an alt-text “GO”.
Now, with Polylang 1.1.4 none of the above works and I get the 404-image I’m using through the whole site, which is rather big…
The website is at www. podium-arts.com
The previous version I remember using was 1.1.2
I’m turning the search-widget back on for the moment, but you have to try a language other than English, through the flags.
Thanks again.
Plugin Author
Chouby
(@chouby)
OK I see. Could you post here the php code of you search form?
Thread Starter
ian6
(@ian6)
Yep,
new theme-version (wil be up if all works):
<form action="<?php echo esc_url(home_url('/')); ?>" class="searchform" method="get" role="search">
<input size="27" type="text" title="<?php echo (get_search_query()!="" ? get_search_query() : __('Search', 'ci_theme') ); ?>" class="s" name="s">
<a class="searchsubmit"><img src="<?php echo get_template_directory_uri(); ?>/images/search.png" alt="<?php _e('GO', 'ci_theme'); ?>"></a>
</form>
and the one online now is:
<form action="<?php echo esc_url(home_url('/')); ?>" class="searchform" method="get" role="search">
<input size="27" type="text" title="<?php echo (get_search_query()!="" ? get_search_query() : __('Site Search', 'ci_theme') ); ?>" class="s" name="s">
<!-- <a class="searchsubmit"><img src="<?php echo get_template_directory_uri(); ?>/images/search.png" alt="<?php _e('GO', 'ci_theme'); ?>"></a> -->
<a class="searchsubmit"><img src="http://www.podium-arts.com/wp-content/themes/wp_pinfinity5-v1.4/images/search.png" alt="<?php _e('GO', 'ci_theme'); ?>"></a>
</form>
NB: the part that is now commented out is the original of this version, the other one is what I thought might work…
:-)))
Plugin Author
Chouby
(@chouby)
I believe it won’t… Polylang modifies any url in the search form. That’s a bug. Only the url of the form statement should be modified.
Could you try to edit the file polylang/include/core.php at line 713 and replace
str_replace(trailingslashit($this->home), $this->get_home_url($this->curlang, true), $form) :
by
str_replace(trailingslashit($this->home), $this->get_home_url($this->curlang, true), $form, 1) :
I am not sure, but maybe the issue comes with the combination WP3.6 + Polylang 1.1.x as the search form function has been modified in WP3.6 and I (tried to) adapt Polylang starting from 1.1
Thread Starter
ian6
(@ian6)
Maybe it’s the combination, because I upgraded to WP 3.6 at the same moment.
I’ll tell you in a moment.
1000 thanks
Thread Starter
ian6
(@ian6)
Well,
now the 404.png is gone, but in the non-English versions no image or alt-text is shown.
On the other side the whole website does strange things (white pages etc and on Chrome error 500)
On safari (different computer) it just doesn’t show the loop-image
Firefox on both mac’s is dead
Plugin Author
Chouby
(@chouby)
Fatal error. Sorry, I badly read the documentation of the str_replace function π
Could you try this?
Replace:
$form = $this->using_permalinks ?
str_replace(trailingslashit($this->home), $this->get_home_url($this->curlang, true), $form) :
str_replace('</form>', '<input type="hidden" name="lang" value="'.esc_attr($this->curlang->slug).'" /></form>', $form);
by:
if ($this->using_permalinks) {
preg_match('#<form.+>#', $form, $matches);
$old = reset($matches);
$new = str_replace(trailingslashit($this->home), $this->get_home_url($this->curlang, true), $old);
$form = str_replace($old, $new, $form);
}
else
$form = str_replace('</form>', '<input type="hidden" name="lang" value="'.esc_attr($this->curlang->slug).'" /></form>', $form);
Thread Starter
ian6
(@ian6)
YEP, let’s see π
Oh, in which file should this code be? (include/core ? or the themes “search form”?)
Plugin Author
Chouby
(@chouby)
This is in polylang/include/core.php, lines 712-714
Plugin Author
Chouby
(@chouby)
The bug fix is now in the development version (1.1.4.2)
http://downloads.wordpress.org/plugin/polylang.zip