get_the_category_list
works on The Loop only and needs a post_id
as a parameter. As a page does not have category, it won’t work by default in a page.
If you want to retrieve all the categories on a page, you should use one of the following:
wp_list_categories
get_categories( array( 'echo' => false ) );
Related Posts:
- exclude multiple terms using get_terms() function
- Counting number of posts in a category and its sub categories and displaying result using shortcode
- Allow authors to post only in categories they create in WordPress
- Add custom field to attachments in a specific category
- How to Populate the list of custom post type categories
- Php string not working in WordPress Functions.php [duplicate]
- Problems with function on function.php
- Use template for posts with a particular category grandparent
- Check if Product is in a Specific Category in Functions.php
- Woocommerce – remove product from category
- get current product name in functions.php
- get post based on category chosen in drop down – The ajax method
- Swapping wp_dropdown_categories function with wp_category_checklist
- Pass Category Name, Description and Photo into variables to pass to jQuery
- How to pick the default selected value in wordpress dropdown?
- Get page that displays all children of taxonomy parent
- Dilemma of Populating all the categories in a drop down list
- Edit the_category (); for a hierarchical display
- Displaying posts based on category
- How to get current post category details inside “loop”?
- Show all tags within a category?
- Post not populating for custom post type based on category selection
- Dropdown category field inside repeatable metabox
- Display Visual Composer shortcode if a post belongs in specific categories
- Get parent category name when only child category is applied to a product
- How to move a post from one category to another
- Notice: Undefined variable
- Hide a specific category title from displaying on site
- Populate Posts based on category selected using AJAX that means without page refresh
- All categories options or All categories not Populating
- Customizing the output of the archive and category widget without altering the original behavior of the widget
- PHP get_category() function redeclared
- Get category id for a custom category and display it in a class
- Trying to see if page is category or single and displaying title with appropriate heading tag
- How to insert the first letter in uppercase [closed]
- Hide child of parent categories already hidden with “get_terms_args” – Woocommerce
- Exclude a category ID from the following function
- Is it possible to disable a function of a parent theme?
- Hide old attachments from wp media library
- PHP – redirect https to http and www to non-www
- How to overwrite youtube embed?
- Need to get specific data from array
- Categories Template Assistance
- Generating add_settings_section() calls dynamically
- Sort registered users by post count? (inside admin dashboard)
- How to change a public function inside a class of a plugin?
- Function set default image when image not present
- WooCommerce – Reset quantity input field when variation changes
- Query all posts of a custom taxonomy term
- Trying to establish connection to External Database
- Login/logout in header
- Error when adding excerpt to the content through functions.php
- Add data attribute to each li in menu
- Applying A Category to Existing Posts Where Page Title Matches Regex
- Get users that likes the post
- How to abort saving data in save_extra_profile_fields function WordPress?
- Get the date of the className or classID
- Way to add captions to gallery images by code
- My custom get_the_excerpt() can’t get excerpt by ID
- WordPress Options Page Theory Question
- deactivating an active plugin using if page
- How to make container class in PHP
- How do I check or test a WordPress Auto Year Change Script?
- How to use the checked() function to check for a non-empty var
- Defining multiple categories for showing latest posts
- Finding and removing duplicates within WP Arrays
- Pagination Not Working (pages duplicating content)
- Custom functions for string data calculations
- How are these PHP functions applied to a specific page in WordPress?
- The additional fee for the COD payment method not visible in the front-end
- “pre_get_posts” orderby custom date field in different format?
- How to show categories and date on posts
- Reliable way to add nonce to HTTP Header in WordPress?
- Trying to update Woocommerce meta values
- php code for outputting a custom page in my account
- ssl redirect function is not working
- Hide specific shipping methode depending on day and time of day
- Adding custom field to product category and show it to shop/category shop page
- Add element after navigation element title don’t works like I expect
- How to auto-generate random numbers in username?
- Get Billing Email from WooCommece Checkout and Pass to Fullstory JS
- How to delete specific element when it is not homepage?
- How to add a custom class for iframe by embed_oembed_html
- remove public static function wp_link_dialog()
- Find the method which AJAX GET calls
- get_category display only 1
- How can I display a query in a page?
- Using catch_that_image() for galleries?
- Make an array listing custom taxonomy
- wp_get_archive for category returning different URLs on different but similar sites
- Conditional Content Display
- Password form redirection to belonging post
- Trouble using wordpress functions in a pop-up modal form
- admin-ajax.php loading many times
- How to add margin underneath woocommerce total price amount -> productpages
- Select area and checkbox data is not saving?
- Suppress errors when using global function
- Keep users logged in Without Remember Me
- How to use js variable to php in wordpress functions.php
- how to create twitter card without plugin in wordpress website?