Categories Listing and Highlighting current category item
-
30-10-2019 - |
سؤال
My query is on Wordpress and related to categories.
I have a set of categories for my posts: All, Cat-a, Cat-b and Cat-c.
a. When I click on the link to my posts page, I want to show an archive for 'All'. How do I generate a link to 'All' explicitly? Something of this kind?
<a href="<?php bloginfo('url'); ?>">All Posts</a>
b. I would also be displaying the list of categories (shown below). I would however need to highlight the current category (by default, All).
<ul>
<?php wp_list_categories('title_li='); ?>
</ul>
c. Also I would need all categories to be displayed whether they have posts in them or not.
Any help on this is greatly appreciated. Thanks!
لا يوجد حل صحيح
لا تنتمي إلى wordpress.stackexchange