handling 404 title internationalization

This commit is contained in:
Antoine M 2023-12-13 11:35:12 +01:00
parent 1dc17263e4
commit de9ed06c5e

View File

@ -1,5 +1,19 @@
<?php <?php
function theme_slug_filter_wp_title($title)
{
if (is_404()) {
$title = __("Page not found - Homegrade", "homegrade-theme__texte-fonctionnel");
}
// You can do other filtering here, or
// just return $title
return $title;
}
// Hook into wp_title filter hook
add_filter('wp_title', 'theme_slug_filter_wp_title');
add_action('template_redirect', 'redirect_to_demo_components_page'); add_action('template_redirect', 'redirect_to_demo_components_page');
function redirect_to_demo_components_page() function redirect_to_demo_components_page()
{ {