Questions tagged [wp-list-categories]

Display or retrieve the HTML list of categories.

Filter by
Sorted by
Tagged with
0
votes
0answers
14 views

Show Subcategories in Specific Menu item Using Walker Class

I want to show subcategories in specific menu item with custom div structure using walker class, My scenario is when I add a category in the menu from backend so show subcategories in that specific ...
0
votes
1answer
101 views

Taxonomy list. Order by a specific custom post type count

I have a custom taxonomy and two custom post types (A and B post types). I created a taxonomy list and this list also display B posts type count of taxonomy. Taxonomy list is ordered by post count. ...
0
votes
1answer
32 views

How to show a list of only categories (exclude subcategories)

I have a list where you show me the categories, but I would like you not to show me the subcategories, only the categories $term_id = get_categories(); if (function_exists('get_wp_term_image')) {...
0
votes
1answer
22 views

Get all the blog's categories and the related URLs?

I'm confused as to how to fetch the list of all the blog's categories (sans empty ones). I need the textual name and the URL to the cat archive as an array. Do I use get_terms(), get_categories(), ...
0
votes
1answer
28 views

How to list categories in reverse alphabetical order?

I am organising posts on a blog-type website into "issues", each containing 10 articles and assigned a unique category such as issue7. Using a sidebar widget I want to list these categories so that a ...
0
votes
0answers
11 views

show posts using wp_list_categories

I want to list all parent, child, grandchild etc. taxonomies and the posts for those. Currently it lists all the taxonomies nicely indented in correct hierarchy but it shows no posts. Can you show ...
0
votes
1answer
20 views

Display All Top Child Categories / Taxonomy

I want to display the top 10 child taxonomies, no parent. This code gets 1 top parent taxonomy, then only displays it's 10 children. I would like to grab top 10 child taxonomies of all parents of ...
1
vote
1answer
28 views

How to exclude children categories of parent category

I want to list only certain categories and exclude a particular parent and all its children. The reason is so that if a new child category is added, it won't show up by default. With ...
0
votes
3answers
103 views

How to show category list in WordPress

If anyone know, if there's plugin to customize taxonomy list it will be faster to do. But here's my question. i create post type "product" and the categories. inside post type product, i make ...
0
votes
1answer
18 views

Retrieving Categories based on the first character of the name

I was wondering how I can get information from the wp_list_categories object just using the first character of the category name. For example, I want to get the listing of categories based on the ...
0
votes
1answer
41 views

Include Parent Term in wp_list_categories

I am using the script below to list the custom taxonomies, but I still need a link to the parent of the current custom taxonomy for an "All" link. Right now the links display as: Shoes Shirt T-...
0
votes
1answer
32 views

Argument for if term-> have child?

I am using the code off this page: https://www.wpbeginner.com/wp-tutorials/how-to-display-child-taxonomy-on-parent-taxonomys-archive-page/ However my Custom taxonomy has more depth for cities, state, ...
0
votes
0answers
16 views

How to list all categories a post is in, but exclude current post´s category on single post page

I´d like to list all categories (links) a post is in, like when I use "the_category()", but need to exclude the current category. Ex: Post name is "Bob Marley´s songs", published in the categories "...
1
vote
1answer
56 views

List subcategories of a specific product category (adapting from posts to products taxonomy)

I made the below for my sidebar to show the subcategories of a specific category (ID 89) of my choosing. Only the subcategories that the post is in appear. Works great. Now I want to change my posts ...
1
vote
1answer
15 views

Highlight “Show all” item in wp_list_categories

I use wp_list_categories to display category filters on post archives. I can use current_category param to set current category - and such item will get addition class current-cat. I can even omit ...
5
votes
4answers
47 views

How to display only 3 main categories, separated by commas, since they are marked in the post?

I want to display only 3 categories (Ex: horses, dogs, birds), names only and comma separated, in my Post, since one of them, two or all tree are marked in the post. <span><?php if ( '...
0
votes
1answer
20 views

How can I display categories on different pages

I am working on a theme. Woocommerce categories are displayed on home page but I need to add on shop page, product page and category page. How can I do this.
0
votes
2answers
36 views

No hierarchy in wp_list_categories with child of and depth

Say a site has a category structure like: Dogs Boxer Fawn Brindle Rottweiler Cats Calico Siamese Using it shows that and adds classes so that you can style it accordingly such as making ...
0
votes
1answer
133 views

Show child taxonomies (that have posts) of the current parent taxonomy

For the life of me I can't see why this isn't working. It works fine like this (normal categories) <?php if (is_category()) { $cur_cat = get_query_var('cat'); if ($cur_cat) { $...
0
votes
0answers
24 views

How to list categories, subcategories and finally posts of selected subcategory

my goal is to create a page, on which I will list all parent categories, then after selecting parent category, it will list all subcategories of parent, and finally if there's no other subcategory ...
0
votes
1answer
37 views

How can I create a Category Index page that lists all categories?

I have themed my category.php file so it now displays all posts that belong to the category that was clicked. The URL looks like [www.example.com/category/news/]. This is good and correct. When I go ...
1
vote
1answer
31 views

How would I go about pulling the most popular (most used) categories?

I am trying to use WordPress' built in function for calling a list of categories. Unfortunately there doesn't appear to be an argument for how to pull the most popular categories (say top 5). I am ...
0
votes
1answer
24 views

Problem with wp_list_category with custom taxomy

I have a custom hierarchical taxonomy and I want to list in a dropdown menu all the top level "category" of the taxonomy that have post. In my functions.php I've added this code: function ...
0
votes
0answers
1k views

List subcategories of active parent category (WooCommerce)

I want to list out the child categories when on the parent category page. Here's what I've got so far: <?php $cat_id = get_query_var('product_cat'); ...
0
votes
3answers
81 views

Show posts from categories instead of tags

I am trying to change this wordpress function given in my theme to show posts from category instead of tags. But due to wordpress beginner i am unable to do this. Please help me to change this code....
2
votes
2answers
507 views

Exclude Child Categories Using wp_list_categories

$category = get_category( get_query_var( 'cat' ) ); $child_cats = (array) get_term_children( $category , 'category' ); wp_list_categories( array( 'exclude' => $child_cats ) ); Is it ...
0
votes
1answer
54 views

How to Retrieve All Category Images on Front-End

I am trying to retrieve all the images from every category. wp_list_categories gives me all the titles of categories but I need only the images of category and the permalinks of the individual ...
0
votes
1answer
803 views

ACF Custom field not showing in Timber Taxonomy page

Issue: I am unable to display ACF custom fields while looping through taxonomies. I have an ACF text field called 'icon'. After applying it to my custom taxonomy 'topic' (and categories while ...
0
votes
0answers
15 views

Alpha list no longer works it multiple names

I have a theme that worked very well using this code but on Version 4.8.3 its no longer valid. $terms = get_terms( "ingredient", array( 'name__like' => $letter ) ); to return all posts where the ...
1
vote
1answer
84 views

Replace li Items with divs with classes

I'm trying to output the categories of my custom post type but instead of them displaying as li items, I woujld like them each to be a div so I can style them in nice floated boxes... The code I have ...
0
votes
1answer
48 views

With wp_list_category put every existing category into an option tag

Like the title says, I'm using wp_list_categories to get all of the existing categories of my website listed. I would like to achieve this: <select class="filters-select"> <option value="....
0
votes
2answers
903 views

Get the category name outside of the loop in category.php

I am in a category.php, and I have to write the category name outside of the Loop. The category name needs to be pulled dynamically through PHP. <p>You are browsing <?php get_the_category ?&...
2
votes
2answers
2k views

List with categories, subcategories and posts of custom posttype

I am trying to query a list with all Categories, Subcategories and Posts of a custom post type. e.g.: Maincat1 -Subcat1 -Post1 -Post2 -Subcat2 -Subcat3 Maincat2 -Subcat3 -...
1
vote
2answers
52 views

How to display terms from a custom taxonomy in a hierarchy AND with custom html markup?

I've created a custom taxonomy (locations) which is hierarchical, and would like to: a) display an unordered list that respects the hierarchy AND b)customize the display output so that I can specify a ...
1
vote
1answer
56 views

Shortcode - Getting Categories appears on top of website

I tried using ob_start but still my categories query in the shortcode appears on top of the site and outside its container. any ideas what's wrong here? function life_shortcode(){ $args = array('...
1
vote
1answer
452 views

Color different for the current category

I would like to change the color of the current category in this page : my code for display category is : <ul class="ul-cat"> <?php wp_list_categories( array( 'orderby' ...
0
votes
0answers
248 views

Add and Custom category for posts “PAGE”

I want to create custom category page for posts "PAGE" for an internal use. The categories will be the list of the clients I want to remove somes fields (like slug, description, parent category ...
0
votes
1answer
91 views

Category removal - Portfolio Category:

I am having trouble removing the "Portfolio Category:" text on this page http://www.dpwilliams.com/project-category/abstract/ which is automatically added to the headline. Is there a way to add a ...
0
votes
1answer
127 views

Alphabetically Ordered Category in Wordpress

In wordpress I'm trying to show the list of categories in a page. I'm simply using the function "wp_list_categories" to show the categories and it actually works pretty well however, I would like to ...
-1
votes
1answer
241 views

Listing categories on a wordpress page

I've been looking for a way to display categories on a wordpress page. I came across the wp_list_categories function which works, but the only downside is that I have a bunch of categories and don't ...
-2
votes
1answer
813 views

custom texonomy category child category list with parent head

hello i just want to make a list of custom child category list under the parent and the parent as a header as bellow
2
votes
3answers
147 views

How can I set custom order use this function

I have a sample: CODE PHP: <ul class="categories-list"> <?php wp_list_categories('title_li='); ?> </ul> This code displays the category list sorted by name. What I want ...
3
votes
1answer
1k views

Get child categories when clicking on parent category

I'm not sure how i do this, i have set it up correctly in the back end so for example i have a category 'bars and pubs' and i have 3 other categories 'x' 'y' 'z' and all there parents are bars and ...
0
votes
1answer
98 views

How to modify default category widget list display?

I am using default category widget in blogs posts page in sidebar. I am able to display categories with count but the view is not looks good. I want to know the file which is having the list . I am ...
1
vote
1answer
1k views

Category list with indent children list below current category

I am trying to create a widget to display all the top level categories of my custom taxonomy that have items in them. If you click on one of the categories, you will go to that page and the current ...
0
votes
1answer
200 views

display a link to all the categories of current post, including parents

amazingly, this seems to be hard, and I don't see the answer anywhere online. simply list all the category of the current post (on single.php), but also all the parent categories of it. <?php ...
0
votes
2answers
1k views

How to create a array that contains all of the children slugs of a specific parent category

I need to create an Array that contains all of the children slugs of a specific parent category ID. Let's say I have the following parent category and its children categories: Food pizza bread ...
1
vote
0answers
450 views

How do I get the sub categories of the parent when in a sub category?

Im having an issue with a widget I'm building. It shows you the sub categories of the selected category page and displays them in a list like so. appologies for the subject of the site. But when I ...
1
vote
1answer
422 views

Swapping wp_dropdown_categories function with wp_category_checklist

I am trying to change a field in a search widget by going into the php files and altering the wp functions. I currently am trying to change a dropdown select box to a check box for categories (parent ...
0
votes
1answer
553 views

Display children of the category a post is assigned to

The following code works to display all child categories of a parent (when viewing a parent category), and all siblings of a child category (when viewing a child category) within sidebar.php. The same ...