• Hello, I’m using Polylang plugin to use multilingual page but I just recognized that WP-knowledgebase search function works only default language. How can I use search function as current selected language? I have also problem with breadcrumb links.

Viewing 1 replies (of 1 total)
  • Thread Starter birtakimseyler

    (@birtakimseyler)

    I’ve found a solution:

    on kbe-template-functions.php file,

    instead of this:

    <form role="search" method="get" id="searchform" class="clearfix" action="<?php echo home_url( '/' ); ?>" autocomplete="off">
                    <input type="text" onfocus="if (this.value == '<?php _e( 'Search Articles...', 'wp-knowledgebase' ); ?>') {this.value = '';}" onblur="if (this.value == '')  {this.value = '<?php _e( 'Search Articles...', 'wp-knowledgebase' ); ?>';}" value="<?php _e( 'Search Articles...', 'wp-knowledgebase' ); ?>" name="s" id="s" />

    paste this:

    <form role="search" method="get" id="searchform" class="clearfix" action="<?php echo esc_url(home_url('/') . pll_current_language() . '/'); ?>" autocomplete="off">
                    <input type="text" onfocus="if (this.value == '<?php pll_e( 'Search Articles...', 'wp-knowledgebase' ); ?>') {this.value = '';}" onblur="if (this.value == '')  {this.value = '<?php pll_e( 'Search Articles...', 'wp-knowledgebase' ); ?>';}" value="<?php pll_e( 'Search Articles...', 'wp-knowledgebase' ); ?>" name="s" id="s" />

    and on kbe-core-functions.php file,

    instead of this:

    jQuery('#live-search #s').liveSearch({url: '<?php echo home_url(); ?>/?ajax=on&post_type=kbe_knowledgebase&s='});

    paste this:

    jQuery('#live-search #s').liveSearch({url: '<?php echo esc_url(home_url('/') . pll_current_language() . '/'); ?>/?ajax=on&post_type=kbe_knowledgebase&s='});

Viewing 1 replies (of 1 total)
  • The topic ‘Problem with multilingual page (Polylang)’ is closed to new replies.