WordPress – tags (tags) from the current category (archive)

Information from an “urgent need to write down not to forget”category. Ah and to share with “near”, of course. The task is to display a list of tags or tags on the category page (archive, headings) in WordPress, and the tags should only correspond to records from the current category.

In this way, we implement a simple filter on labels or a specialized cloud of labels on the pages of the heading.

Next, the actual code for adding labels to the category page:

1. Added to the file function.php current theme:

2. Display the label list itself. You add to the page template category or column in the desired location on the display. In different themes can be on ways: category.php, archive.php (usually standard).

Well, all-this code will display on the category page a list of tags with links to their pages separated by commas. After a little “shamanism” with css, I turned out such a nice thing:

 wordpress tags from current category

How to make – you decide – no restrictions. And so – we have implemented a simple filter for tags entries from the current category of WordPress on their own and without additional plugins. By the way what is the functionality of many plugins is in the pro versions, for demanding money, or most of these plugins require you to create a page in which to insert shortcodes and only litter your blog with extra pages and extra code. And then 5 minutes and everything is ready – and most importantly – all done with their own hands and we know what comes from where and where to be displayed.

Leave a Reply

Your email address will not be published. Required fields are marked *