Site logo

Archived topic

Override Archive title

1 reply · Started by Bebop on March 27, 2021

Viewing posts 1–2 of 2

I'm currently doing this in my functions file, to remove the "Archive: " from the archive title.


add_filter( 'get_the_archive_title', function ( $title ) {

    if( is_post_type_archive('myCPT') ) {

        $title = 'Example Title';

    }

    return $title;

});

Is there a GP-specific way of doing this or some other better way?

Hi there,

thats the correct way of doing it as its a WP function that generates the prefix.

This archived topic is closed to new replies.