2011-08-06 11 views

答えて

2

あなたのテーマのヘッダーはwp-content/themes/your-theme/header.phpで簡単に編集できます。そして、文字の数に応じて、タイトルを変更:これは私がこれを使用し、この点で最高の

<title><?php 
    $title = wp_title(' - ', false, 'right'); 
    if (strlen($title) > 120) $title = substr($title, 0, 117) . "..."; 
    echo $title; 
?></title> 
0
<a href="<?php echo $blogUrl; ?>?p=<?php echo the_ID(); ?>"> 
<?php 
    if (strlen($post->post_title) > 120) { 
     echo substr(the_title($before = '', $after = '', FALSE), 0, 120) . '...'; 
    } else { 
     the_title(); 
    } 
?> 
</a> 
関連する問題