What about using the exclude
array key in your get_categories()
call?
e.g. change this:
$massive_categories_obj = get_categories('hide_empty=0');
to this:
$massive_categories_obj = get_categories('hide_empty=0&exclude=14');
Note that exclude
expects a comma-separated string as a value.
For your second function, what are you passing as $exclude
?
function retrieve_cat_data_sp( $exclude ){
$args = array(
'hide_empty' => '0',
'exclude' => $exclude
);
$massive_categories_obj = get_categories($args);
Are you passing a comma-separated string, an array, or something else?
What do you get from this get_categories( $args )
call? Try a var_dump( $massive_categories_obj )
to see what it’s returning?
Related Posts:
- Redirect depending on category chosen
- Get rid of WordPress category, tag and author archives?
- How to add the category ID to admin page
- How to create a widgetized sidebar for every category dynamically?
- Saving two categories from two dropdowns in front end posting form
- Only show category to certain user levels without plugin
- List Categories of the Parent Category of the Current Category
- wp_list_categories, Add class to all list items with children
- Remove “Parent” Selection When Adding/Editing Categories?
- Check is category parent or not from its ID
- How to retain the values from dropdown category lists after wrong form submission?
- How to show in search results posts with a particular tag in a particular category?
- How can I get an tag to wrap each ancestor that gets outputted in this condition?
- If category is in parent category?
- If in category to be inside of a function
- Rename Default Category (Uncategorized) Via a Function
- Check child/parent categories if exists
- Getting URL of archive (category) page
- How to show only one category in breadcrumb navigation
- Additional form options based on category selected not working
- Query posts from category based on a filter most favorited
- Add tag parameter to category.php
- Random Featured Image Based on Category
- add slug beside name in Admin Category Checklists
- Change div background acording to the selected category
- How to use wp_list_categories with plugin category?
- Search form options group categories
- How to add icon over specific thumb
- How to load several hierarchical categories from functions.php
- Change Default Content when Creating a Post based on Previous Category Choice
- How to add a custom thumbnail size for a specific category?
- Exclude category from drop down list form
- create function to call category name and slug
- Different size video display for category page (smaller) & detail page (larger)
- Default URL for category dropdown select option
- wp_category_checklist won’t show up for non-admin users
- Code to display category-specific single.php is overriding normal single.php, too
- Loop Through Categories in Custom Field
- Function to list posts from current post’s category fails in WP 3.8
- Ajax call activate after submit in edit-tags.php page
- Show only one category in main query, issues on tag page
- Categories as selectable links on submission form
- Show parent-child relationship for categories in the wordpress admin
- Checklist of selected categories
- Multisite – Protect categories from deletion?
- ajax category filter
- Custom color for each category name
- Show posts of one category only with Custom Taxonomy on single.php
- Wrap a chosen category name with div
- custom permalinks for category archive ( custom base and no parent slug )
- Get tags specific category
- show posts names and links in the sidebar list as categories child
- Filter posts under multiple categories?
- How to show Sub Categories on Categories page?
- multiple categories and breadcrumbs problem
- Get all subcategories and related posts
- How to get data about category in category.php
- Remove 2 categorgies when post status changes from private to publish
- Offline WordPress Application
- Add Image Size for one Media Category Only
- How to Customize the category list page
- New Categories Not Shown In the Post Edit Page
- Different templates for different category tags
- Place category Base URL at the end
- Listing Texts of Which Custom Field is Null
- How to set a filter by category within a customised page
- Post Count for Categories, however not to calculate a total
- Flat category URLs but retaining hierarchy?
- Creating a custom feed for categories that includes the first post’s featured image
- Get categories without post
- Display thumbnails for certain category posts
- Hide the word ‘category’ from my permalinks
- School & class blogs – renaming/archiving post categories?
- How to modify default category widget list display?
- List just subcategory and products of active category page in Woocommerce
- Custom Meta Box (SELECT2) Not Saving Taxonomy Terms
- Listing posts under a category by date
- Display content from a specific category using cat ID not working
- Deleting a category from WordPress admin does it remove it completely from the database?
- Add description to categories menu in admin
- filter a loop base on specific category
- How can i listing current category and Featured Category post list?
- Custom sidebar isn’t showing up on sub-category posts
- get_the_category return empty inside loop
- Possible to make get_categories() hide_empty attribute honor excludes from post query?
- Hide a specific category title from displaying on site
- How to call Primary Category for WordPress Woocommerce
- Save All Post Permalink From A Specific Category into a .txt file
- Tag Menu items based on their categories
- How to exclude a specific categogy from a custom page template
- Category Templates for Post Types not Working
- Change category base based on category
- Display default WordPress login/registration form into a modal window
- altering theme – content generated by PAGES not PORTFOLIO
- Need help with category page customization meeting certain condition
- How can i call from custom fields to the category editor?
- How do i add custom post types to this query?
- add new input field like category?
- chose category in plugin
- How to Allow Users to Select Recipients In a WordPress Comment section?