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
- Anyway to hide a Category in the Categories section when adding/editing a post in WP Admin?
- Dynamically Adding Category Specific Content To Specific Category & Subcategory Pages
- How do I list all child categories that apply to current post?
- Featured image for links and categories
- Structure with category setting
- Category articles “read more” links not active
- Custom Fields to Category edit page, then displaying them in a template correctly
- WordPress category gives 404 after moving to a different domain
- How to create a custom loop ordered by Categories on a Page Template?
- Showing one post from each category, paged?
- chose category in plugin
- How to change category id on get_posts array
- How do we display a certain category type on a page while hiding all others?
- Template files not working for archives and categories
- Create custom Perma link
- Query posts that have all the specified tags
- Multiple Parent Category URLs
- How can I show page per category in wordpress? (Yes, category by page!)
- has_category not working correctly
- How to get most recent categories – categories whose most recent posts published
- Back to category link
- Custom Woocommerce Category view
- Category Template – to be editable from the backend?
- Random post order into Category Pages
- How do I add and display a custom image field to a category? [duplicate]
- comments_number fails to print
- Chained drop-down menu for custom taxonomy using chained.js
- How to display the posts belonging to a paticular category
- get posts from 2 categories. (2 posts)
- WordPress 3.5 how to determine if user is on category listing or category edit screen?
- Why Pagination is not working on Category.php
- ajax form function error
- How to prevent page load on form submission
- Javascript code for Category
- Display post content from category name using ajax
- How to assign different categories to pages in wordpress?
- Display only one level subcategory in wordpress
- How to get child category list post in one template?
- Display all subcategories for a product category in woocommerce
- How to display a linked category name with get_the_category
- why is the delete option missing from just one category?
- Call function on a single page
- Not able to display category link and name [closed]
- How to prevent uppercasing of menu titles
- Only show sub-category
- how to ask if in two categorys inside if
- Narrow Down a Shop Page Results Based on a Product Tag in WooCommerce
- Help Me “in_category” with echo? [closed]
- How to control order when displaying child categories
- Send foreach $_post method to contact form 7 [closed]
- Can i know if it is Category first page or 5th?
- Displaying categories
- Country Ways Content Show
- Broken category styling
- How can i hide the authors box from a specific set of categories and post types?
- Do not show all post from all categories, just show posts from category in current loop
- 2 Categories using same template but one has a problem? [closed]