2013-10-13 2 views
1

저는 터키어 블로거입니다. 나는 워드 프레스 블로그가있다. 내 블로그의 404.php 페이지의 제목은 "아무것도 찾을 수 없습니다 % value %"이고 그것을 변경하고 싶습니다. header.php의 title 태그에서 변경할 수 없습니다. 그럼 내가 어떻게 할 수 있니?자료 Wordpress 404.php 제목

image of problem

이 헤드 태그 사이에 내 코드

<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/css/fontello.css" /> 
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.min.js"></script> 
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> 
<title> 
    <?php 
     if(is_404()) { 
      echo 'Error 404 - Page Not Found | '; // or Whatever you want 
      bloginfo('name'); 
     } 
     else 
     { 
      wp_title('|', true, 'right'); //bloginfo('name'); ?> <?php if (is_single()) { ?> &raquo; <?php } ?> <?php wp_title(); 
     } 
    ?> 
    </title> 
<meta name="keywords" content="" /> 
<meta name="description" content="" /> 
<meta name="robots" content="index, follow" /> 
<?php wp_get_archives('type=monthly&format=link'); ?> 
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" /> 
<link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" /> 
<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" /> 
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> 
<link rel="profile" href="http://gmpg.org/xfn/11" /> 
<?php if (is_singular()) wp_enqueue_script('comment-reply'); ?> 
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('stylesheet_url'); ?>" /> 
<link rel="shortcut_icon" href="<?php bloginfo('template_url'); ?>/css/img/favicon.ico" /> 
<?php wp_head(); ?> 
+0

업데이트 된 버전보기 –

답변

1

if statement 시도입니다 :

UPDATE를

<title> 
    <?php 
     if(is_404()) { // if it's 404 page 

      echo 'Error 404 - Page Not Found | '; // or Whatever you want 

      bloginfo('name'); 

     } else if(is_single()) { // if it's single (post) 

      echo '&raquo;'; 

      wp_title();    

     } else { 

      wp_title('|', true, 'right'); 

     } 
    ?> 
</title> 
+0

이것이 작동하지 않습니다. –

+0

테마에'wp_title();을 제어하는 ​​특수 함수가있을 수 있습니다. –

+0

그래서 어떻게해야합니까? 나는 어떻게 speacial 함수를 찾을 수 있습니까? –

0
function change_404_title(){ 

    if(is_404()) 
    return "your custom title here"; 
} 

add_filter('wp_title', 'change_404_title', 10, 1); 
+0

도움에 대해 감사드립니다. 모든 서구 플러그인에서 –