All in one seo packなどのプラグインを使わずにmeta discriptionyakeywordを自動生成する方法
以下のページに詳しく書いてあります。
↓
http://on-ze.com/archives/817
<meta name="description" content="<?php
if(is_home()){ ?>トップページに表示したいdescriptionを書く<?php }
elseif (is_single()){
echo $content_summary; }
else { ?><?php bloginfo('description'); ?><?php } ?>">
$content_summary= strip_tags($post->post_content);
$content_summary = ereg_replace("(rn|r|n)", "", $content_summary);
$content_summary = mb_substr($content_summary, 0, 60). "...";
<meta name="keywords" content="<?php
if(is_home()) { ?>トップページに設定したいキーワード,キーワード①,キーワード②<?php }
elseif (is_single()){ ?><?php $posttags = get_the_tags();if ($posttags) {foreach($posttags as $tag) {echo $tag->name . ','; }} ?><?php the_title(); ?><?php }
else { ?>デフォルトのキーワード①,デフォルトのキーワード②<?php } ?>">
関連記事はこちら!
スポンサーリンク






