• Resolved sher21

    (@sher21)


    hi
    is it possible to customize search result page in customizr

    Please help …i have been struggling to find the solution

    whenever i click on search button this happen
    http://www.mydomainname.com/?s=
    how can i modify this ?s= page

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi,
    this is a normal wordpress permalink,
    you might want to change the permalink structure under Settings -> Permalinks?

    Thread Starter sher21

    (@sher21)

    i think you misunderstood my question
    sir i dont have problem with the url

    all i want is to customizre search result page

    please have a look at my website
    hospitalnation.com

    whenever i click on search button some search result page opens up showing the result.
    i want to customize that particular page like putting up filter search options in the sidebar
    how do i do that

    Ah,
    I see.
    Well in Customizr it’s handled as other contexts, so all in the index.php (search page with no results, though is handled differently), it’s basically a list of posts.
    So you can change the layout of the search page changing the global layout, this, though will affect all the archives pages (archive, category ..).
    So, if you want to change just the search pages layout, add this to your child-theme functions.php :

    /* right sidebar, replace r with l if you want a left sidebar or b if you want both sidebars*/
    add_filter('__screen_layout', 'my_layout', 20, 2);
    function my_layout($id, $arg){
        if ( ! is_search() )
            return $id;
        if ( $arg == 'class'){
            $global_layout = TC_init::$instance -> global_layout;
            return $global_layout['r']['content'];
        }
        return 'r';
    }

    and then with some plugin like widget logic you can chose which widget display in that sidebar page.
    Hope this helps.

    Thread Starter sher21

    (@sher21)

    it worked …thanks a lot

    but it is showing a problem in category (city) and tag (speciality) search

    for eg. if i put the hospital name it shows the result in the same page but if i select any city (without putting any hospital name) in the sidebar it displays the result but then again the left side is gone

    please have a look at the site once again for more clarification

    ‘Cause when you do that, you don’t go in search results pages, but in categories or tags pages, so :

    if ( ! is_search() )
            return $id;

    ’cause they aren’t search and the global layout is used. This is how that plugin works, it brings you to the category or tags page when you don’t put a query string.

    Thread Starter sher21

    (@sher21)

    yeah that what i figured looking at your code.

    ok i think i got it…i changed the global default layout from full width to left sidebar and now the problem is solved.

    Thanks a lot for your enlightenment.

    one last question

    currently the search result display title of post and excerpt (approx 50 words)…what if i want to display other features of my post like overall user rating or some phone number mentioned in the post..how do i do that
    for reference
    http://www.tripadvisor.in/Search?q=bangalore&geo=&pid=3826&returnTo=http%253A__2F____2F__www__2E__tripadvisor__2E__in__2F__

    Thread Starter sher21

    (@sher21)

    thanks a lot for helping me

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘how to customize search result page’ is closed to new replies.