Filters questions

This topic contains 33 replies, has 3 voices, and was last updated by  Stiofan O’Connor 4 years, 6 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #513733

    Scott Robins
    Free User
    Post count: 100

    Hi Stiofan

    I am just following up on the call from Tuesday, were you able to come up with a way for us to do the field / filter without having to create multiple CPT’s or is this something you need to build ?

    Kind Regards

    Scott

    #515552

    Scott Robins
    Free User
    Post count: 100

    Hi Stiofan

    Just wondering when you hope to have the CSS you mentioned on our call ?

    Kind Regards

    Scott

    #515814

    Scott Robins
    Free User
    Post count: 100

    Hi Stiofan

    Any update ?

    Kind Regards

    Scott

    #516322

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Not tested but something like this

    // Add cat id as body class
    add_filter( 'body_class', '_my_cat_body_class');
    function _my_cat_body_class($classes){
        
        if(is_tax() || !empty($_REQUEST['spost_category']) ){
            $tax_id = isset($_REQUEST['spost_category']) ? absint($_REQUEST['spost_category']) : get_queried_object_id();
            $classes[] = 'catid-'.$tax_id
        }
    
        $classes;
    }

    The above will add a class per category to the body so you could then use CSS to show/hide each filter somthing like,

    body.catid-123 .geodir-filter-container .gd-field-special_offers,
    body.catid-321 .geodir-filter-container .gd-field-special_offers{
    display:none;
    }

    Thanks,

    Stiofan

Viewing 4 posts - 31 through 34 (of 34 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket