Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    You can remove category field by adding following code in your theme functions.php or by creating a new plugin and pasting this code there.

    add_filter("adverts_form_load", "remove_category_dropdown");
    function remove_category_dropdown( $form ) {
        if($form["name"] != "advert") {
            return $form;
        }
        foreach($form["field"] as $k => $field) {
            if($field["name"] == "advert_category") {
                unset($form["field"][$k]);
            }
        }
        return $form;
    }

    Is there a way to hide a specific category from the frontend? For example, if we created a category called “featured”, and manually assigned paid posts to that category?

    Plugin Author Greg Winiarski

    (@gwin)

    Currently the best you could do (without some more advanced custom programming) is add following code in your theme CSS file

    .advert_category-100 { display: none }

    This will hide category with ID 100 from the list in dropdown, but note that more advanced users will still be able to ‘hack’ it and select this category.

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