wp_list_categories() not showing
-
I posted this to a previous topic I had made for a related issue, but perhaps this would be better placed here with a less ambiguous title, where others could benefit from the support for a more relevant issue:
After searching the forums for a solution, I still cannot get wp_list_categories() to work.
I have placed it before the loop, and even with categories for which I know there are posts, i still get “No categories”.
For example:
https://www.be-hold.com/category/category
is a parent category to
https://www.be-hold.com/category/category/contemporary-color
which, as you can see, does contain postsHere is a snip-it of code from my Categories page. The page loads posts if the visitor is viewing the subcategory/child, or a list of the available sub-categories of the three parent categories (with ids 27, 24 and 23):
<?php if (is_category())
{
$category_id = get_query_var(‘cat’);
if ($category_id == ’27’ || $category_id == ’24’ || $category_id == ’23’) { ?>-
<?php wp_list_categories(‘child_of=$category_id’); ?>
<? }
else {
/* USER IS ON A SUB-CATEGORY, SO SHOW POSTS */Thanks
- The topic ‘wp_list_categories() not showing’ is closed to new replies.