Support » Plugins and Hacks » [Resolved] [Plugin: Polylang] is_search() not working

[Resolved] [Plugin: Polylang] is_search() not working

  • RRikesh


    Hello Chouby

    I have a problem on my search results page. The function is_search() isn’t being triggered. I tried other is_xxx() functions and saw that it is is_tax() that is being triggered with the language name as term – tested with the following code:

    $term = $wp_query->get_queried_object();
    $title .= $term->name;

    The url structure of the results page is:

    From the url structure, I guess it is because the language is being considered as a taxonomy that is_tax() is being triggered.

    For the time being I’m using this hack when using is_tax() to detect the results page:

    if( 'English' == $term->name || 'Fran├žais' == $term->name ){
          if( function_exists( 'pll_register_string' ) ){
            $title .= pll__( 'Results Page' );

    Is there any direct way to detect the search result using is_search() or the method mentioned above is the good way to proceed?

    Polylang Version: 0.9.3


Viewing 1 replies (of 1 total)
  • Plugin Author Chouby


    It’s curious that I don’t reproduce this problem with is_search()
    However I tried to suppress the is_tax flag on search pages (issue that I reproduced easily) in the current development version (
    Maybe this will solve your issue with is_search

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] [Plugin: Polylang] is_search() not working’ is closed to new replies.