Support » Plugin: WP Store Locator » Hide specific categories

  • Resolved oxign

    (@oxign)


    I’m using 2 maps. But I need to use the drop down category menu for one of them. Is it possible to hide specific categories?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    Yes this is possible with the code. It does require the ID of the category that you want to hide. You can find the category ID by clicking on it in the admin area, and then grab the value after tag_ID.

    
    add_filter( 'wpsl_dropdown_category_args', 'custom_dropdown_category_args' );
    
    function custom_dropdown_category_args( $args ) {
    
        if ( is_page( 'your page name' ) ) {
            $args['exclude'] = array( '1','2' ); // The category IDs.
        }
    
        return $args;
    }
    

    The code has to go in the functions.php inside your active theme folder.

    • This reply was modified 2 years, 6 months ago by Tijmen Smit.

    Thanks Tijmen, works perfect!

    And if I want to hide the results for those categories if ANY/ALL is selected?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hide specific categories’ is closed to new replies.