Timbul pertanyaan, "Setting SEO Tanpa Plugin SEO Wordpress?". Wah beruntung ada temen yang berkenan share. Kuncinya Edit Function.php masukan Kode Berikut:
function meta_seo() {
$desc_length = 30;
$use_excerpt = 1;
$key = 'diskripsi';
global $cat, $cache_categories, $wp_query, $wp_version;
if((is_single() || is_page())&& !is_attachment()) {
$post = $wp_query->post;
$post_custom = get_post_custom($post->ID);
$custom_desc_value = $post_custom["$key"][0];
if($custom_desc_value) {
$text = $custom_desc_value;
} elseif($use_excerpt && !empty($post->post_excerpt)) {
$text = $post->post_excerpt;
} else {
$text = $post->post_content;
}
$text = str_replace(array("\r\n", "\r", "\n", " "), " ", $text);
$text = str_replace(array("\""), "", $text);
$text = trim(strip_tags($text));
$text = explode(' ', $text);
if(count($text) > $desc_length) {
$l = $desc_length;
$more = '...';
} else {
$l = count($text);
$more = '';
}
$description = '';
for ($i=0; $i<$l; $i++)
$description .= $text[$i] . ' ';
$description .= $more;
if($description) {
echo "<meta name=\"description\" content=\"$description\" />\n";
}
$postTags = get_the_tags();
if($postTags){
$tagNames = array();
foreach($postTags as $tag) {
$tagNames[] = $tag->name;
}
}
$kiword = implode($tagNames,", ");
if($kiword) {
echo "<meta name=\"keywords\" content=\"$kiword\" />\n";
}
}
elseif (is_paged() || is_day() || is_tag() || is_search() || is_month() || is_year()) {
echo "<meta name=\"robots\" content=\"noindex,follow\" />\n";
}
}
Lalu EDIT Header.php, masukan kode berikut:
<?php meta_seo(); ?>
</head>
CATATAN: Woke? jurus Setting SEO Tanpa Plugin SEO Wordpress di ats bekerja ketika postingannya ada tagnya. Kalau misal nggak masukin tag di artikelnya ya akan terjadi eror :).
Home
jurus seo
Komunitas SEO Klaten
memulai wordpress
plugin wordpress
Setting SEO Tanpa Plugin SEO Wordpress
Setting SEO Tanpa Plugin SEO Wordpress

Share to your friends
Artikel Terkait
Newsletter
Berlangganan artikel terbaru dari blog ini langsung via email
Subscribe to:
Post Comments (Atom)
1 Komentar so far
Itu langsung generate auto apa masukin manual ?
Sharekan bagaimana pandanganmu sendiri mengenai artikel di atas..
EmoticonEmoticon