Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [wp-list-categories]

Display or retrieve the HTML list of categories.

0
votes
1answer
16 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
20 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
70 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
14 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
26 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
30 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
21 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
15 views

How to create wordpress category like this

i use this code for auto category listing but its show like this Android (3) but but need counter css also without braket any one can help me /😞
0
votes
0answers
739 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
2answers
46 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
410 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
45 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
596 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
14 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
67 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
38 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
774 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
1k 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
39 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
46 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
265 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
148 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
62 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
69 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
154 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
589 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
131 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 ...
4
votes
1answer
852 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
89 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
896 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
120 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
410 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
343 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
487 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 ...
0
votes
1answer
64 views

list categories based on updated posts [closed]

I mean to order the of categories should be based on the updated posts. The category which has most recent post should come up first and so on. Suppose, I have 50 categories and i add new post very ...
4
votes
2answers
2k views

List of subcategories with featured image

In a page, I need to display a list of all sub categories of a specify category. For example, in the category Sport have 6 subcategories: Swim Football Basket Ski Hockey Each ...
0
votes
2answers
856 views

Access current post parent and sub category

I need to show in the each post his parent category and sub category, at the moment I use this code: <?php $categories = get_the_category(); echo 'Parent Category: <a href="' . esc_url( ...
4
votes
1answer
2k views

wp_list_categories: order by term order?

I am currently using WordPress' wp_list_categories function in order to retrieve my terms from a specified taxonomy. I like this function for its ability to generate (hierarchical) HTML lists, that ...
0
votes
0answers
481 views

how to avoid reloading/refresh the page when displaying the post of wp_list_categories

I have a wp_categories_list in my site and it displays all of my categories. Now when i click one of my category, it displays the posts within that category by refreshing. How can i avoid refreshing/...
0
votes
1answer
81 views

How to list categories by page id in wordpress

I want to create a sidebar with below hierarchy. All courses, padi courses (these are pages) ---divetravel (these are categories) ---suba courses (these are categories) Can someone help me out ...
2
votes
4answers
1k views

wp_list_categories exclude not working

I'm try to exclude a specific category from a list of categories that a custom post has (in this case 'Uncategorized' - ID: 1). I've tried exclude: wp_list_categories([ 'include' => ...
1
vote
1answer
18 views

How to change number of items on add new pluggins page from backend?

When adding new plugins, the list is too short, and I have to click on next, next , next... Is there a way to change the number of items to be displayed to something like 100 or 500?
0
votes
2answers
37 views

Breaking Categories Up into Individual Divs

I've been working with the wp_list_categories( $args ); to display categories from a taxonomy and I feel that this might be the wrong method to use. Now I'm wondering if it is possible to instead of ...
1
vote
1answer
939 views

How to show Sub Categories on Categories page?

I have a product page which is assigned as category.php. Now i want to show Sub Categories as Sub Menu on the Category page. But even after searching alot i couldn't show all sub categories yet. I ...
0
votes
1answer
25 views

Getting list of Categories for Custom Post Types

I'm trying to generate a list of the categories of my custom post types ('products', and 'specialties'), and nothing will display. Does anyone know what's wrong with this code?? EDIT: The below code ...
0
votes
1answer
495 views

wp_list_categories with category description

It seems to me that category_description should be an option in wp_list_categories. Is there way to pull the description when listing all categories?
0
votes
1answer
134 views

Trying To Get Child Categories To Show, Issue With foreach Loop

I made 6 sub-categories, all children of my "Resources" category, and I'm trying get them to display on a page, but at the moment it's only displaying the first category (leading me to believe my ...
-2
votes
1answer
34 views

Listing category and its posts one by one

I want to show all category and its posts as below in a page, for a dynamic website. Please help -category a -post a1 -post a2 -post a3 -category b -post b1 -post b2 -post b3
9
votes
2answers
956 views

How To Create A Paginated List Of All Categories On My Site?

I want to display an archive page with pagination that lists all the categories on my site, and each link goes to that particular category archive page. So this would be like an archive page of ...