¡¡¡¡ÄÇôÔÚ²»Ê¹Óòå¼þµÄÇé¿öÏÂÈçºÎ×ö³öÒ»ÑùЧ¹ûµÄ±êÌâÓÅ»¯ÄØ£¬À´¿´¿´±¾ÈËÏÖÔÚµÄÉèÖ㬴˷½·¨Êdzö×ÔÁø³ÇµÄÎÄÕ·ÖÏí(Áø³ÇÊÇË?È¥Ä격°ÙÓÅSEO´óÈüµÄNO.1)£¬²Ù×÷·½Ê½ÓÐÁ½ÖÖ£º
1¡¢ÏÈ°ÑÔÀ´header.phpÀïµÄ
¼äÕâ¶Î´úÂë¸ÄΪÔÙ°ÑÒÔÏÂеĴúÂë±£´æÔÚdesc.php¾ÍOKÁË£¨Èç¹ûÓÐÖÐÎĵĻ°£¬¼ÇµÃÁí´æΪÎļþµÄ±àÂëÊÇUTF-8¡£Çмǣ©£¬°Ñdesc.phpÉÏ´«µ½ÄãµÄÖ÷ÌâµÄĿ¼Ï¡£
¡¡¡¡2¡¢£¨±¾ÈË×Ô¼ºµÄ×ö·¨£©°Ñheader.phpÀﺬ
µÄ´úÂëÓÃÒÔÏÂеĴúÂ븲¸Ç¼´¿É£¬µ«ÓÐЩÖ÷ÌâµÄÎÞ·¨Ê¹Óã¬ÒòΪÓÐЩÖ÷ÌâµÄheader.phpÀï²¢ÎÞ
<>php ……Ö®Àà¡£
¡¡¡¡ÐµĴúÂëΪ£º
ÒÔÏÂΪÒýÓõÄÄÚÈÝ£º | ËÑË÷½á¹û | | | | | | ##¶¨ÒåÒ»¸öº¯Êý.½â¾ö½ØÈ¡ÖÐÎÄÂÒÂëµÄÎÊÌâ if (!function_exists('utf8Substr')) { function utf8Substr($str, $from, $len) { return preg_replace('#^(?:[x00-x7F]|[xC0-xFF][x80-xBF]+){0,'.$from.'}'. '((?:[x00-x7F]|[xC0-xFF][x80-xBF]+){0,'.$len.'}).*#s', '$1',$str); } } if ( is_home() ){ $description = "ÕâÀïÌîдÄ㲩¿ÍµÄÃèÊö"; $keywords = "ÕâÀïÌîдÄ㲩¿ÍµÄ¹Ø¼ü´Ê"; } elseif ( is_single() ){ if ($post->post_excerpt) { $description = $post->post_excerpt; } else { if(preg_match('/(.*) /iU',trim(strip_tags($post->post_content,"")),$result)){ $post_content = $result['1']; } else { $post_content_r = explode("n",trim(strip_tags($post->post_content))); $post_content = $post_content_r['0']; } $description = utf8Substr($post_content,0,220); }
$keywords = ""; $tags = wp_get_post_tags($post->ID); foreach ($tags as $tag ) { $keywords = $keywords . $tag->name . ","; } } ?>
±¾ÎĵØÖ·: http://www.it300.com/article-3715.html
Êý¾ÝÕýÔÚ¼ÓÔØÖС
|
ÆÀÂÛ