<?php
// Change <title></title>
function my_title($title) {
$title['title'] = 'My title';
$title['site'] = $title['site'];
return $title;
}
add_filter( 'document_title_parts', __NAMESPACE__ . '\\my_title', 10, 2 );
// With Plugin "Yoast" installed:
function my_seo_title($title) {
$title = 'My title';
return $title;
}
add_filter( 'wpseo_title', __NAMESPACE__ . '\\my_seo_title', 10, 2 );
wp 5.x
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.