Display or retrieve the HTML list of categories.

learn more… | top users | synonyms

4
votes
2answers
371 views

current_cat_ancestor Alternatives

It looks like adding current-cat-ancestor class to category list was proposed, but never implemented. The only way I've been able to find so far is to re-create the wp_list_categories() function ...
3
votes
3answers
12k views

Woocommerce Product Category Widget - hide categories that have no products in stock [closed]

I'm using WooCommerce on my Wordpress site, and have a widget in the sidebar showing all product categories. It's setup to hide empty categories, and that works well. However, it still shows ...
3
votes
1answer
2k views

How can I custom order the results from wp_list_categories?

I am using wp_list_categories to return (you guessed it) a list of categories within a custom taxonomy. The orderby parameter accepts sorting by ID, name, slug, count, and term_group. Is there a way ...
2
votes
1answer
131 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 ...
2
votes
1answer
742 views

How to highlight all current categories when viewing a single post?

When viewing a single post, the wp_list_categories function already marks the current category of this particular post by assigning the current-cat CSS class. If the post is mapped to multiple ...
2
votes
1answer
1k views

Category count inside the link

Is it possible using wp_list_categories set count of post in category in the href?
2
votes
2answers
14k views

How can I customize the wp_list_categories

I have a list of categories in woo-commerce which I'm trying to customize to be displayed to look like the following image. I created the above image using normal HTML and css however I would like ...
2
votes
1answer
147 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 ...
2
votes
1answer
487 views

Changing post category from dropdown

I am showing a list of posts on the front of my wordpress site which each have a dropdown next to them with a list of category's, which are pulled in as follows. As you can see the form submit button ...
2
votes
1answer
286 views

Manipulate Output of wp_list_something: select menu instead of li's

I'm working on a responsive webdesign where my navigation should swap into a select-menu when resizing the window in smaller sizes. Is it somehow possible to add another param to functions like ...
2
votes
2answers
1k views

Add class to Categories Widget

I have a few default widgets which I am using in a custom sidebar and I'd like to edit its output in my functions.php file. Currently the categories widget and blogrolls are generating an unordered ...
2
votes
0answers
196 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: ...
2
votes
1answer
772 views

Walker gives additional taxonomy name?

I'm a beginner at Wordpress, so I would appreciate it if any of you could nudge me in the right way. Anyway, what irks me is how wp_list_categories (and similar functions) produce a lot of unnecessary ...
1
vote
1answer
5k views

Adding ul class with wp_list_categories Custom Walker

I am trying to achieve something that seems like it should be simple but is causing me headaches. I am listing my categories out using wp_list_categories which gives me this... <ul> ...
1
vote
1answer
3k views

Get category ID from category slug (not working)

I found this code, which apparently gets the category ID from the category slug: $category = get_category_by_slug('category-name'); $id = $category->term_id; But when I try to implement it ...
1
vote
1answer
2k views

get_category_link() is returning nothing

<?php $categories=get_categories('taxonomy=galeriak'); foreach ($categories as $category) { ?> <li><a href="<?php echo get_category_link( $category->term_id ) ?>" ...
1
vote
1answer
40 views

Using separator with wp_list_categories

How can I use separator with wp_list_categories using inline list? In documentation they say (string) Separator between links. Default '<br />'. Well I guess that means I could use HTML right? I ...
1
vote
3answers
73 views

How do I remove the <br> tags from wp_list_categories?

If I pass in 'style' => 'none' as an argument to wp_list_categories, the <li> tags are removed. That's great, but <br> tags are injected. How can I remove them?
1
vote
3answers
2k views

Add Class While on Current Post; wp_list_categories

The code below produces a sub-menu of child categories of the currently active parent category. This code also produces the child categories of the top parent category while viewing child categories ...
1
vote
1answer
376 views

How do I reset this wp_list_categories query?

How do I reset a query that generates a list of categories with wp_list_categories? The query below builds a two column list of categories that is then displayed with the second code chunk. I'm ...
1
vote
1answer
130 views

Creating a category page by alphabet

i'm new to wordpress, and i don't know how to code. I would like to make a page where all my animes are sorted by alphabet, like in this image I've heard about the wp_list_category function, so i ...
1
vote
1answer
121 views

Insert HTML inside link in a walker

I've got a custom nav walker that (theoretically) pulls the featured image from the most recent post in a custom taxonomy, and displays the the image after the link in a wp_list_categories. The ...
1
vote
1answer
138 views

List all blog categories

I have created a blog plugin. I have the blog category in my blog. I would like to get the list of all the blog categories and list it in my www.domain.com/blogs/ page. My blog category name is ...
1
vote
1answer
74 views

Arrange Combined List of Pages and Categories

I'm using the code below to display both top-level pages and categories in my menu. (If this is the incorrect way to do so, please let me know). I would like to arrange the items alphabetically. The ...
1
vote
1answer
253 views

Modification to wp_list_categories

I dug this up to help me modify wp_list_categories and place the featured image from the latest post in that category, inside the generated li. class CategoryThumbnail_Walker extends Walker_Category ...
1
vote
1answer
265 views

Insert <ul> Into Sub-child Menu

This code displays a list of child categories of the parent category while a user is on a child category or single post. The styling around this list is displaying even when a list isn't being ...
1
vote
2answers
176 views

how do you prevent showing a particular category on the admin dashboard for specific user roles?

I'd like to prevent the "Featured" category from appearing for certain user roles. To be specific, I want only the admins and editors to be able to see and thus select or unselect that category. ...
1
vote
1answer
1k views

Using wp_list_categories to show more than one custom taxonomy

I'm using wp_list_categories like this: $taxonomy = 'colors'; $orderby = 'count'; ...
1
vote
2answers
32 views

shop page with all categories with paginate

I am very new in wordpress theme development. how can i make page template for my store page where my all categories listed with 6 to 10 latest post with that category and category name has a link to ...
1
vote
1answer
224 views

wp_list_categories() - adding a div to each li?

I am using wp_list_categories() to print out a link to each category from a specific author ID which is working fine. However, I would also like to add a div to each li which will hold an icon for the ...
1
vote
1answer
93 views

Strip a word from wp_list_categories

With the following code I am showing a list of sub categories: <ul class="subcats-blog"> <?php if ( is_category() ) { $current_cat = get_query_var('cat'); ...
1
vote
1answer
170 views

Display Taxonomy Terms in an option tag with value being the slug

I have a custom taxonomy filled with terms that I wish to display in a fashion such as below. <option value="[SLUG]">[TERM]</option> <option value="[SLUG]">[TERM]</option> ...
1
vote
1answer
1k views

Using wp_list_categories like the the_category (showing just current categories of a post)

fromi'm using wp_list_categories to get an unordered list with headlines (on single.php inside the post-loop): <ul><?php wp_list_categories('title_li=0');?></ul> the thing is: i ...
1
vote
1answer
763 views

How can i list current author's categories?

My Code getting authors written post categories but just 2 ID has author lists category.. I replace $current_user->ID but it is not worked. <?php $categories = $wpdb->get_results(" ...
1
vote
1answer
628 views

Giving wp_list_categories the class of the category

I am using wp_list_categories to list my categories in my menu. When the menu is generated each category is listed as a <li>-element with "cat-item[number]" as class. Is there a way to also or ...
1
vote
1answer
2k views

wp_list_categories() - current-cat class also inside posts?

I wrote my own function to list all taxonomy terms of a certain taxonomy … function wr_list_taxonomy($taxonomy, $orderby, $hierarchical) { $show_count = 0; $pad_counts = 0; $title ...
1
vote
1answer
221 views

Post specific text based on category displayed

So I'm working on a site and I need a news page that is slightly different. It is a post category but I want the text echoed at the top of the news category listing. <?php endif; ?> <?php /* ...
1
vote
1answer
346 views

List Sub-Categories of a Parent Category

I need to be able to list categories that are the sub-category of a specific category that is a sub-category of a primary category. So something like this: Print Categories where ParentCategory = ...
1
vote
0answers
19 views

Filtering a custom post type by custom taxonomy in archive template

I've seen this question posted in different forms before, but most of those solutions are centered around the admin interface, and I haven't found any answers that apply to the front end. I've got a ...
1
vote
1answer
30 views

Get categories with posts by custom field value

I have a big categories tree (~2000 total subcategories)... And I have a lot of posts with custom field "city" (different values). I have created filter posts by "city" field. But I have problem with ...
1
vote
0answers
22 views

Categories as main menu items and subcategories as nested lists

I am new to WordPress and am trying to make my website. Would it be possible to list categories and subcategories as a nested list with links in the main navigation menu. What am i trying to achieve ...
1
vote
1answer
99 views

wp_list_categories depth and number

My code is as follows: $custom_args = array( 'orderby' => 'name', 'order' => 'ASC', 'depth' => 1, 'number' => 4, ); ...
1
vote
0answers
54 views

wp_list_categories

I wonder if anyone could shed some light for me. I have updated wordpress and one of my plugins has stopped working, which is also up to date. I have narrowed it down to exactly what isnt working the ...
1
vote
0answers
223 views

show count is out of the anchor tag in wp_list_categories

I'm using wp_list_categories with 'show_count' enabled on that, i styled my <a> tag, but the category count doesn't show up under anchor tag.(it's under li) $args = array( ...
1
vote
1answer
54 views

List of Posts and Categories

I have a custom taxonomy of Species and a custom post type of Animals. I would like to display them in a tree view like so: All Animals Fish (taxonomy term) Shark (Custom Post Type) Sun Fish ...
1
vote
1answer
29 views

How to display all the categories a post is in

How do I display all of the categories that a post is in, in sentence format. eg. cars, boats, aircraft, bicycles.
1
vote
1answer
46 views

Order categories by most posts

How can I list the categories by most posts News(100) Updates(45) Alerts(20) and so on
1
vote
1answer
296 views

List Taxonomies: Don't list taxonomy if it has no post - depending on custom post-meta?

This might be complicated to explain and I don't know if there is a solution to that!? I have a custom-post-type named "wr_event" and a hierarchical custom-taxonomy named "event_type". The ...
0
votes
2answers
161 views

How to list all categories in three divs dynamically based on the quatity of categories?

I have 15 categories. I list this using <div class="category_list"><ul><li><?php wp_list_categories();?></li></ul></div> Now it's listing all 15 categories ...
0
votes
2answers
164 views

Categorie parents and childs displayed

I'm trying to create a menu directly hard-coded, basically I need to display the parent category and below its child categories, however I have to do this several times meaning something like this: ...