M
M
Muvka2018-05-27 12:02:13
WordPress
Muvka, 2018-05-27 12:02:13

How to change the title of custom posts?

Hello. For all pages on the site, the title looks like this: Page title | Name of the site. There is a custom post type - portfolio and a page with the same address. There is an archive-portfolio.php page. But on such pages the title looks like this: Page Title - Site Title. Those. through dash. Can this be fixed somehow?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Muvka, 2018-05-27
@Muvka

So no one suggested it. Decided to change the default separator.

add_filter( 'document_title_separator', function( $sep ) {
    return '|';
} );

A
Alex-1917, 2018-05-27
@alex-1917

This is solved with two lines of code in functions.php, read vp-kama and you will have chocolate!
And for everyone who advises, TO CHANGE ONE TAG TO INSTALL A COMBINE, which is also raw and constantly requires new spare parts - drive in three necks !!!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question