Returns an array of category objects matching the query parameters. Arguments are pretty much the same as wp_list_categories and can be passed as either array or in query syntax.

learn more… | top users | synonyms

0
votes
2answers
31 views

Get categories query not working in function.php

I am trying to get the categories of my custom post type in functions.php But it not return any value, when i run this query in any theme file it work fine. Here is my code function ...
0
votes
1answer
20 views

Get child categories of custom taxonomy category?

I am using custom post type : portfolio and have taxonomy for that portfolio_category. I need to get sub categories for a particular category using the above custom taxonomy. In short, How can I get ...
0
votes
0answers
10 views

Linking categories and assigning posts in bulk

I am looking for a way to link categories in such a way, that e.g. if you assign few posts to a category, they will automatically be assigned to another category which is linked to the first one. Here ...
0
votes
1answer
26 views

showing tag beside catagory

thanks for your guidance, here is one last but not least thing for me to learn, i am using Today news wordpress theme, since with your help i have moved my process from category to tag based ...
0
votes
0answers
20 views

dynamic menu parent and child category

I'm trying to create a dynamic menu listing all my category and subcategory.. from that im having 2 problems: first one: it display only the category and subcategory being populated by some post, iw ...
0
votes
0answers
46 views

How to sort category by custom field value

I am using the following : $catargs = array( 'meta_key'=> 'category_custom_order', 'orderby' => 'meta_value_num', 'order'=> 'ASC', ); but I can get the ...
0
votes
1answer
21 views

Show all child categories associated to post ID within loop

I'm looping through all posts and I'm trying to output the category nicename related to each post. So if there are categories A,B and C with post X only associated with categories A and C then I only ...
-1
votes
2answers
37 views

How to display category list with category description

I have five categories for a custom post type, additionally I have installed a plugin to enable upload image to each category detail, actually I can get show list of categories with details. I need to ...
2
votes
0answers
54 views

How to show subcategories in categories else show posts

I have hierarchy like this: Category1 -Subcategory1 -Subcategory2 --Post1 Category2 -Subcategory1 I need to show subcategories name and description when i go to category//// Now i use this code: ...
0
votes
1answer
24 views

get_categories returns top-level categories instead of child categories

I've made a basic subcategory nav menu using the code below. The problem is on one category (with NO children), it returns the Top Level categories as children, e.g.: News, Uncategorized, etc. (I've ...
0
votes
0answers
125 views

show/display/print list of sub-categories (of a specific parent category) assigned to products that have a specific other category

I have to find the products assigned to a specific category and after,just about those products, show the list of sub-categories of a specific parent-category here's a example scheme: product 1 - ...
0
votes
2answers
32 views

Limiting number of related posts

I'm trying to add a related posts section to the bottom of my single post views. It needs to grab the categories of the current post and show just 2 posts that match any of those categories. I'm ...
0
votes
2answers
82 views

Using ACF custom field for custom post type to order categories

I'm trying to use this answer to order categories based on their Advanced Custom Fields custom field: track_order. I'm able to get the UL to print fine and show the custom field numbers but I'm ...
0
votes
2answers
51 views

Latest updated categories list query, exclude one from displaying

I have this query: $cat_array = array(); $args=array( 'post_type' => 'post', 'post_status' => 'publish', 'exclude' => '187', 'posts_per_page' => 19, ...
1
vote
2answers
149 views

Exclude category by slug for for each loop

I am trying to exclude some categories from a for-loop. <?php $categories = get_categories(array('exclude' => 'apps, windows')); ?> <?php foreach ($categories as $category) : ?> ...
0
votes
2answers
460 views

Display sub categories of a parent product in products - woocommerce [closed]

I have searched this forum for the possible solutions but I am not getting anything which works. Maybe I am doing it the wrong way. Here is the code that I have tried so far $parent_categories = '' ...
0
votes
1answer
94 views

Get archives as array

I'm looking for a way to get the values returned from wp_get_archives as an array, similar to get_categories. I need to do this to modify the post counters to use - [#] instead of (#). See my current ...
0
votes
2answers
115 views

list all categories that have a certain word in title

How to list all the categories that have a certain word in title - first word of the category? in category.php so, for example, if I am viewing the category "Green Apples Sells", it will list all the ...
0
votes
0answers
47 views

Categories in the wrong order php

I have this code of php and it pulls categories in the wrong order <?php $args = array( 'hide_empty' => false, ...
0
votes
0answers
12 views

Get latter category child of a parent category

guys! I need to get the last child of a category within a loop : category -category son --categoria last child
0
votes
1answer
32 views

Get images by category

My current way of getting the images for sliders is by using the following code that works perfectly: $args = array( 'post_type' => 'attachment', 'sort_order' => 'ASC', ...
0
votes
1answer
73 views

Getting the first parent of a hierarchical term

How get avô this hierarqui category: avô -mae --filho It always give me the last child : <?php $product_cats = wp_get_post_terms( get_the_ID(), 'product_cat' ); $single_cat = ...
0
votes
1answer
126 views

Get current_parent_category in a loop or Cat ancestor- big problem

Im having some trouble since a week now . .. I'm having a bad time with that ! I explain my situation: I have setup a style for post category. (a background-color and a small image background). ...
0
votes
1answer
69 views

get parent_category class in loop

I'm trying to have the parent_category class in my loop. I've tried this: <a href="#" class="<?php $parent = get_category($cat); echo $parent->category_nicename;?>"> <?php ...
-1
votes
1answer
162 views

loop mix my child-category and parent-category

i explain the situatio I'm having: I have a blog, which on the homepage, have display the most recent post. For each post category, I have set up one specific color and icon by css. ex: for ...
0
votes
1answer
91 views

WordPress - List Sub Categories and Sub-Sub Categories, With Posts

I have the following code. It allows me to show sub categories and documents within them. The thing is, a sub category may contain further sub categories. The code below will show documents belonging ...
0
votes
1answer
78 views

Only list category if it has a custom field image

i've a problem showin a list categories. $args = array( 'orderby' => 'name', 'order' => 'ASC' ); $categories = get_categories($args); foreach($categories as ...
0
votes
0answers
74 views

How To Get WordPress Categories Last Update Date?

I am trying to make a custom sitemap for my WordPress blogs categories. For that I added the below code in my functions.php file and save it. Now all things is working fine but I want to get the date ...
0
votes
1answer
115 views

Display 2nd category, only once, as sub-heading, in the loop

I have a Custom Post Type ("Rental"). I am using the code from this article I found to display Rental custom posts on a page, with the Categories of a custom Taxonomy ("Region") as headings between ...
1
vote
1answer
53 views

How To Get WordPress Categories Link List?

I am trying to make a custom sitemap for my WordPress blogs categories. For that I added the below code in my functions.php file and when I save it, my Blog goes white. Nothing is showing up. I ...
0
votes
1answer
228 views

Function/Class to list categories with checkboxes

I want a list like in the pictue; witch is here - Posts->New->Select Categories At the moment i have this echo '<select name="pn-cats[]" size="8" style="width: 100%" multiple>'; $args = ...
0
votes
0answers
54 views

get_categories that have 12 extra fields

I add extra fields for all category. like this :- //add extra fields to category edit form hook add_action ( 'edit_category_form_fields', 'extra_category_fields'); //add extra fields to category edit ...
0
votes
1answer
117 views

How to select single category in menu if post have two categories?

My website's post have one, two, three etc categories depends on articles. My menu is made of categories. when i select post (open whole article) it shows post category in menu. Problem : when i ...
1
vote
1answer
975 views

how to get value of wp_dropdown_categories

I am making a widget and I have used the wp_dropdown_categories() function in that widget. What I can't figure out is how to get the selected value from the dropdown. What variable is the selected ...
0
votes
2answers
72 views

Undefined property: stdClass::$id when retriving term ID

I have the following: foreach( $this_post_terms as $term ) : $thiscat = get_term_by( 'slug', $term->slug, 'categories_whatever' ); echo $thiscat->ID; endforeach; The last line throws an ...
0
votes
1answer
193 views

Category with description and thumbnail

I am using the below codes to show all Parent Terms from a custom taxonomy with title and link on a page. But I want to show the parent term description, thumbnail and post count in it too. So how I ...
0
votes
1answer
62 views

Display the category name of a post that is in two different categories

I'm trying to get the category of a post that is in 2 different category. One category is always "Featured" and the other changes. I can only see the word Array() This is my code: <?php $args = ...
0
votes
2answers
86 views

Category specific order

I am trying to figure out how to display the categories in a specific order. Let's say my category IDs are in the following order: 1,3,4,2,5 I want to display the categories in that sequence. Here is ...
0
votes
0answers
30 views

Get custom type category from a category posts

I've been searching the way to do it but no good. The title may be confusing, let me explain my problem... I have the archive page (the main category), then I've posts inside that category and inside ...
1
vote
1answer
696 views

Get subcategories with JSON API plugin

How to get subcategories with JSON API wordpress plugin? I see how to get categories, but what is the way to get categories with subcategories at the same time? How should I modify the existing code? ...
1
vote
3answers
870 views

get only sub category ID

i need to get only sub category ID. i already get sub category id but it coming with main category id too bellow is code <?php while ( have_posts() ) : the_post(); ?> <option ...
0
votes
1answer
318 views

get_terms from registered taxonomies not working

In functions.php I can var_dump() taxonomies like: $taxonomies=get_taxonomies('','names'); echo '<pre>'; var_dump($taxonomies); which give me: array(7) { ["category"]=> string(8) ...
0
votes
1answer
1k views

Display Categories or Subcategories with name & description in category.php

I have the following issue for my customer. Can some suggest a possible solution to this issue? This website has Categories & Subcategories Cat1 -Subcat1 -Subcat2 -Subcat3 Cat2 -Subcat1 ...
0
votes
2answers
207 views

If posts category is “cars”, display image

Can someone translate this: If posts category is "cars" show image For example: I have an article with category 'car' and another article with category 'banana'. No I'm looking for a way to add an ...
1
vote
2answers
381 views

User Defined order on get_categories?

Below is some basic code to call specficic categories to our front page post loop. It works fine, except my client wants the categories displayed in a particular order. I know there are other posts ...
1
vote
1answer
54 views

Proper syntax or method for keeping url in modified isotope / category links

I'm setting up a project gallery using isotope jquery plugin for layout and filterability. I've seen examples of how to add a list of category links and modify them to filter on click, but... I want ...
0
votes
0answers
60 views

Related sub category posts with thumbanils

I want to show sub sub category posts and title Like Parent Cat Sub Cat Sub Sub Cat <--- I use the following code but shows me all posts from Parent cat , sub cat and sub sub cat posts. ...
2
votes
1answer
97 views

Get the category is not working on url

Although this is my first post but i have been coming here for answers so I know the rule and this isn't a duplicate because i have tried whatever i could but couldn't seem to get my codes to work. ...
0
votes
0answers
24 views

Paginate Term Archive? [duplicate]

I have a custom template displaying an "archive" of terms. When a term is clicked it takes the user to a list of all the posts assigned that term. I am not using a traditional loop to achieve my term ...
0
votes
2answers
53 views

Show all sub categories?

Is it possible to show all child/sub categories of all parent cats? I have the following hierarchy: Parent Cat/Tax -- Sub 1 -- Sub 2 Parent Cat/Tax 2 -- Sub 1 -- Sub 2 I would like to be able to ...