<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title><?php if ( is_home() ) {   
        bloginfo('name'); echo "-"; bloginfo('description');   
    } elseif ( is_category() ) {   
        single_cat_title(); echo " - "; bloginfo('name');   
    } elseif (is_single() || is_page() ) {   
        single_post_title();   
    } elseif (is_search() ) {   
        echo "搜索结果"; echo " - "; bloginfo('name');   
    } elseif (is_404() ) {   
        echo '页面未找到!';   
    } else {   
        wp_title('',true);   
    } ?></title>  

<?php   
if (is_home() || is_page()) {   
    // 将以下引号中的内容改成你的主页description   
    $description = "你来选是一个抱着乐于分享的心情来为大家推荐最值得购买的产品，本站精选淘宝网各种分类中的优质产品来推荐给大家，让大家从你来选中找到最适合最廉价且性价比最高的产品，我们的口号是你购物，我推荐，你来选！";   
  
    // 将以下引号中的内容改成你的主页keywords   
    $keywords = "你来选, 购物, 淘宝购物";   
}   
elseif (is_single()) {   
    $description1 = get_post_meta($post->ID, "description", true);   
    $description2 = mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 200, "…");   
  
    // 填写自定义字段description时显示自定义字段的内容，否则使用文章内容前200字作为描述   
    $description = $description1 ? $description1 : $description2;   
      
    // 填写自定义字段keywords时显示自定义字段的内容，否则使用文章tags作为关键词   
    $keywords = get_post_meta($post->ID, "keywords", true);   
    if($keywords == '') {   
        $tags = wp_get_post_tags($post->ID);       
        foreach ($tags as $tag ) {           
            $keywords = $keywords . $tag->name . ", ";       
        }   
        $keywords = rtrim($keywords, ', ');   
    }   
}   
elseif (is_category()) {   
    $description = category_description();   
    $keywords = single_cat_title('', false);   
}   
elseif (is_tag()){   
    $description = tag_description();   
    $keywords = single_tag_title('', false);   
}   
$description = trim(strip_tags($description));   
$keywords = trim(strip_tags($keywords));   
?>   
<meta name="description" content="<?php echo $description; ?>" />   
<meta name="keywords" content="<?php echo $keywords; ?>" />  

<link href="<?php bloginfo( 'stylesheet_url' ); ?>" rel="stylesheet" media="screen" type="text/css" />
<?php if ( is_home() ) {   
  echo  "<script language="."javascript"." type="."text/javascript". " src=\"";bloginfo('template_directory');echo "/js/jquery.min.js\""."></script>";
  echo  "<script language="."javascript"." type="."text/javascript". " src=\"";bloginfo('template_directory');echo "/js/jquery.sgallery.js\""."></script>";
  echo  "<script language="."javascript"." type="."text/javascript". " src=\"";bloginfo('template_directory');echo "/js/newitems.js\""."></script>";
  echo  "<script language="."javascript"." type="."text/javascript". " src=\"";bloginfo('template_directory');echo "/js/tqq.js\""."></script>";
  echo  "<script language="."javascript"." type="."text/javascript". " src=\"";bloginfo('template_directory');echo "/js/dedeajax2.js\""."></script>";
 } elseif ( is_category() ) {   
   echo  "<script language="."javascript"." type="."text/javascript". " src=\"";bloginfo('template_directory');echo "/js/jquery.js\""."></script>";
   echo  "<script language="."javascript"." type="."text/javascript". " src=\"";bloginfo('template_directory');echo "/js/superfish.js\""."></script>";    
   echo  "<script language="."javascript"." type="."text/javascript". " src=\"";bloginfo('template_directory');echo "/js/myjs.js\""."></script>";
   echo  "<script language="."javascript"." type="."text/javascript". " src=\"";bloginfo('template_directory');echo "/js/dedeajax2.js\""."></script>";

 } elseif (is_single() || is_page() ) {   
      
  echo  "<script language="."javascript"." type="."text/javascript". " src=\"";bloginfo('template_directory');echo "/js/jquery.min.js\""."></script>";
  // echo  "<script language="."javascript"." type="."text/javascript". " src=\"";bloginfo('template_directory');echo "/js/m.js\""."></script>";    
   echo  "<script language="."javascript"." type="."text/javascript". " src=\"";bloginfo('template_directory');echo "/js/updown.js\""."></script>";
   //echo  "<script language="."javascript"." type="."text/javascript". " src=\"";bloginfo('template_directory');echo "/js/dedeajax2.js\""."></script>";
 echo  "<script language="."javascript"." type="."text/javascript". " src=\"";bloginfo('template_directory');echo "/js/jquery.js\""."></script>";
   echo  "<script language="."javascript"." type="."text/javascript". " src=\"";bloginfo('template_directory');echo "/js/myjs.js\""."></script>";

 } elseif (is_search() ) {   
    ;   } elseif (is_404() ) {   
       ;   
    }  ?>

<link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/images/favicon.ico"/>
</head>