Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @param $title
- * @return array
- */
- function archive_titles($title): array
- {
- global $post;
- $type = $post->post_type;
- $types = [
- 'custom_post_type' => 'Custom title',
- ];
- if (is_archive() && isset($types[$type])) {
- $title['title'] = $types[$type];
- }
- return $title;
- }
- add_filter('document_title_parts', 'archive_titles');
Add Comment
Please, Sign In to add comment