archives.php
Functions for archive pages display.
Tags
Table of Contents
Functions
- add_course_filter() : void
- Show a course filter on selected archive pages.
- modify_archive_order() : void
- Change sort order of archive pages where required.
- archive_redirect() : void
- Redirect selected archive pages.
- modify_archive_title() : string
- Remove prefix for taxonomy name from archive titles.
- set_excerpt() : string
- Set excerpt if no custom excerpt.
Functions
add_course_filter()
Show a course filter on selected archive pages.
add_course_filter(WP_Term $archive_term) : void
Parameters
- $archive_term : WP_Term
-
The archive term.
Tags
modify_archive_order()
Change sort order of archive pages where required.
modify_archive_order(WP_Query $query) : void
- Do not change order on admin pages.
Parameters
- $query : WP_Query
-
The WP_Query instance (passed by reference).
Tags
archive_redirect()
Redirect selected archive pages.
archive_redirect() : void
- Redirect top level recipes category archive to content page.
Tags
modify_archive_title()
Remove prefix for taxonomy name from archive titles.
modify_archive_title(string $title, string $original_title, string $prefix) : string
- Leave date and author prefixes unchanged.
Parameters
- $title : string
-
Archive title.
- $original_title : string
-
Archive title without prefix.
- $prefix : string
-
Archive title prefix.
Tags
Return values
string —The (maybe) modified archive title.
set_excerpt()
Set excerpt if no custom excerpt.
set_excerpt(string $text, string $raw_excerpt) : string
- If no explicit excerpt is set, generate an excerpt from the complete first paragraph of the content.
Parameters
- $text : string
-
The trimmed text.
- $raw_excerpt : string
-
The text prior to trimming.
Tags
Return values
string —The (maybe) modified excerpt.