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

1
vote
0answers
23 views

How to show custom taxonomy in the permalink?

I used the Portfolio Post Type Plugin to create custom tax and post type. I would like to show the custom taxonomy on the portfolio projects. portfolio/customtaxonomy/project while now is ...
0
votes
2answers
25 views

Get Category Archive Template Name Dynamically

I'm making a category archive template that works for all my categories. I need to dynamically set the 'category' parameter of WP_Query inside of this template to make it work. How do I dynamically ...
2
votes
1answer
116 views

How to list all categories and tags in a page?

Suppose we have few categories, tags and custom post type and taxonomies. How can we list all categories, tags in a page? Something like; Page Category Thumbnail and Category Name 1(link to ...
0
votes
2answers
38 views

How to display taxonomy terms the way they are hierarchical

Reading Kaiser's query and Scribu's answer I'm now in an ocean of no shore. I made a custom taxonomy, where I want to show the terms as per their hierarchy, like below: Level 0 -- Level 1 --- Level 2 ...
0
votes
1answer
26 views

Difference between wp_list_categories and get_categories

Whats the difference between the wp_list_categories and get_categories? Wordpress codex says use get_categories if needs a function that does not format the results what format is this ...
0
votes
0answers
24 views

Getting posts for a category

I have a menu made up of categories, click a category shows the users list of articles beloging to said category. However I seem to have stumbled across a problem if a post belongs to 2 or more ...
0
votes
1answer
46 views

List posts of assigned categories in list of all categories on single.php

here's what I'm trying to accomplish: I've got several categories, each of them have several posts. Now, on category.php I'm able to output a list of all categories and, inside this list, show a list ...
0
votes
1answer
27 views

Group child category IDs based on their parent category

I have IDs for my child categories, 11,14,21,35,38,39, where these all are various child categories from their main category: Parent category 1 has: 11,14 Parent category 2 has: 21 Parent category 3 ...
0
votes
1answer
65 views

using checked function to verify value against an array

I have a 2-level taxonomy terms checkbox list (created with get_categories) that stores values into the usermeta table. I'd like to display the checked items when the page is refreshed. This is the ...
0
votes
0answers
14 views

Order get_categories() by the order they show up in the backend

I am using Woocommerce and have 1800 products that are in 18 different categories. The idea is to have a page display these 18 different categories as links to their archives. The problem is I want ...
0
votes
1answer
98 views

Get the child category ID of current category

I am trying to get the category ID of the child (no grand children) of the current category. Using below method: $category = get_category(get_query_var( 'cat' )); // get category ID $catid = ...
2
votes
1answer
87 views

Category Archive, list subcategories of each post

I found this post, but it was never answered. I'm looking for the same thing, haven't been able to find a solution so far. My problem is that I can't find a way to list subcategories unique to each ...
0
votes
1answer
68 views

How to get category link without a database query

I use Wordpress 4.3.1 with PremiumPress Business Directory Theme. The theme's homepage renders a list of categories using code that's basically: $args = array( 'taxonomy' => ...
0
votes
0answers
127 views

How to add a Load More button for get_categories()?

I want to add an Ajax "Load More" button for category post display. I want to show only 6 categories per page. However, the other categories are loading after clicking on the button. Can anyone help ...
0
votes
0answers
21 views

View list of categories from values ​​in custom fields

Through the Advanced Custom Fields created a field to add values ​​in each category. example: Category A = Cars Category B = Aircraft Category D = Boats Category E = Aircraft Category F = Boats ...
0
votes
0answers
32 views

easy digital download , dropdown category

i want to show download category as a dropdown button for each category , and sub category list base on category. i searched , and use my knowledge , result: <?php function my_list_edd_terms() { ...
0
votes
1answer
795 views

woocommerce - how to get product link by id

i have 2 product_cat Product cat 1 id : 6 Product cat 2 id : 8 in my index how to get product cat link with id or slug as: <a href="Product cat 1 (link)">Product cat 1(name)</a> <a ...
0
votes
1answer
303 views

WP Dropdown Categories, display subcategories but not grandchildren categories?

So my main goal is to create 3 drop-down category options to run a search. It's for a car website, so I have 3 parents, "Make", "Model", and "Year" At the moment I have the following code <?php ...
0
votes
2answers
202 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
180 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
19 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
30 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
122 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
272 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
68 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
162 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
162 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
45 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
182 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
45 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
272 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
94 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
431 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
1k 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
219 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
221 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
74 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
23 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
81 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
149 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
340 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
123 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
217 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
207 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
121 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
121 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
190 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
61 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
532 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
1answer
186 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 ...