0

You can see the archive.php's title php code on twenty fifteen theme here:

<?php
                the_archive_title( '<h1 class="page-title">', '</h1>' );
                the_archive_description( '<div class="taxonomy-description">', '</div>' );
            ?>

I would like to add some custom text after category/tag title. Can I do that with archive.php? How to do that? In twenty fifteen theme both category and tag pages use archive.php.

0

Before anything, you should create a child theme, so you can update the parent (Twenty Fifteen) without worries.

Looking at the WordPress hierarchy, you could copy the archive.php to the child theme and edit it, but would need to check what archive it is, of posts, custom post types, etc.

Instead, copy archive.php twice, rename one to category.php and one to tag.php. You could even use category-{slug}.php for specific categories (same goes for tags).

// in category.php / tag.php / ...
the_archive_title( '<h1 class="page-title">', '</h1>' );
_e('Some custom text','twentyfifteen-child');
the_archive_description( '<div class="taxonomy-description">', '</div>' );
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.