This topic has 10 replies, 3 voices, and was last updated 6 years by Radu.

  • Author
  • #196880
     banana7777
    Participant

    Hi,

    I like to hide the sidebar just on the search result page. How can I achive this?

    Thanks and best regards,

    Dirk

    #196896
     Kieran_SQ
    Moderator

    Hi,

    Please try the below custom CSS in your KLEO Child theme to remove the sidebar on the search results page and make the content full width.

    COPY CODE
    .search-results .sidebar {
        display: none !important;
    }
    .search-results .template-page.col-sm-9.col-sm-push-3 {
        width: 100%;
        left: 0;
        border-left: 0;
    }

    Make sure to purge your website cache, autoptimize, CDN and front-end cache to see the changes.

    Thanks,

    Kieran

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #196897
     banana7777
    Participant

    This is a bad solution to hide via CSS. Do you have a hook to look at?

    Thanks,
    Dirk

    #196899
     Kieran_SQ
    Moderator

    Hi,

    I cannot see if you have applied the CSS that I have provided or not because you’re using Autoptimize. I have cleared my cache but I do not see any changes.

    In what way is this a bad solution for CSS? If you would prefer to make changes to theme files instead of using CSS please copy the search.php file from the main theme into your KLEO Child theme and make any desired PHP changes.

    Thanks,

    Kieran

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #196901
     banana7777
    Participant

    I have not applied this to the site as this is not a good solution for my point of view. You are generating things that you in a second step hide for ever? Not good solution.

    I will dig into the code by myself. Thought I would get here an indication in what direction I have to look. But okay.

    Best,
    Dirk

    #196907
     Kieran_SQ
    Moderator

    Hi Dirk,

    I see and that’s a fair point, the best place to start is as above in the search.php file (once copied to the KLEO Child theme). I will refer this ticket to one of our developers for review and to potentially offer a more dynamic solution to removing the sidebar on search pages.

    They’ll be in touch with you as soon as they can, Monday to Friday, East European Time.

    Thank you for your patience,

    Kieran

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #196923
     banana7777
    Participant

    That’s great. Thanks.

    In the meantime I added this one to my functions.php (not live site). Is it okay to call from kleo_before_main?:

    COPY CODE
    add_action('kleo_before_main','distillery_switch_layout',10);
    function distillery_switch_layout() {
    	if (is_search()){
    		kleo_switch_layout('full');
    	}
    }
    #196928
     Kieran_SQ
    Moderator

    Hi,

    Absolutely, I tested your code locally and it works nicely.

    Kieran

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #197001
     Radu
    Moderator

    Yes it’s ok

    Let me know

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #197031
     banana7777
    Participant

    Thanks for letting me know. Just wanted to know if there might be some side effects.

    #197036
     Radu
    Moderator

    No problem
    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 11 posts - 1 through 11 (of 11 total)

The forum ‘Plugins questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?