Answer the question
In order to leave comments, you need to log in
How to make different titles on the post card and on the post page?
I wholeheartedly welcome everyone. There was a problem with the site design: adding keywords to the title. It's easy to add them to the standard header, but they spoil the card of the post itself. Is it possible to make different headings in the card and on the post page? How to apply this code only for headers on single pages?
add_filter( 'the_title', 'suppress_if_blurb', 10, 2 );
function suppress_if_blurb( $title, $id = null ) {
return '';
return $title;
}
Answer the question
In order to leave comments, you need to log in
add_filter( 'the_title', 'add_text_to_page_title' );
function add_text_to_page_title( $title ) {
if ( in_the_loop() && is_single() ) {
$title = 'Смотреть: '. $title;
}
return $title;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question