我有一个网站,使用worddress catch box theme,我想改变404页面标题。 我在编辑器的PHP文件中寻找“Nothing found for”句子,但是我什么也没找到。我想改变一个wordpress主题的404页面标题
我搜索了get_header();在编辑器中更改标题的方法,但我没有找到它。
我有一个网站,使用worddress catch box theme,我想改变404页面标题。 我在编辑器的PHP文件中寻找“Nothing found for”句子,但是我什么也没找到。我想改变一个wordpress主题的404页面标题
我搜索了get_header();在编辑器中更改标题的方法,但我没有找到它。
已经被在这里找到答案:https://wordpress.stackexchange.com/questions/30873/how-to-change-404-page-title
添加以下主题functions.php
文件
function theme_slug_filter_wp_title($title) {
if (is_404()) {
$title = 'ADD 404 TITLE TEXT HERE';
}
// 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');
您可以使用筛选器挂钩
function theme_slug_filter_wp_title($title) {
if (is_404()) {
$title = 'ADD 404 TEXT HERE';
}
return $title;
}
add_filter('wp_title', 'theme_slug_filter_wp_title');
我可以添加这些代码行吗? – TowTiw