13

Tag Posts Excerpt Display with Archive.php

 3 years ago
source link: https://nixmash.com/on-wordpress/tag-posts-excerpt-display-with-archive-php/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Tag Posts Excerpt Display with Archive.php

Our Series Twenty Seventeen continues with an example of setting Tag Post display to excerpts using the WordPress archive.php file. We want to go from this:

tagexcerpts1002a.png

To this:

tagexcerpts1002b.png

We’ll do that by adding an archive.php file to our Child Theme.

tagexcerpts1002e.png

About the WordPress archive.php file. An archive page in WordPress is referring to a collection of posts grouped by category, author, date, tag, etc. If you look at WordPress file.php you’ll see a number of file templates listed that you can add to your theme along with their function. We could have added a tag.php file and got the same results, but we’ll use the multi-purpose archive.php.

tagexcerpts1002c.png

We simply copied the WordPress archive.php file to our Child Theme root, then modified it accordingly.

tagexcerpts1002d.png

CategoriesWordPressTagsPHP, WordPress


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK