WP ใส่ keyword , description

WP ใส่ keyword , description


<meta name="Keywords" content="<?php wp_title('&laquo;', true, 'right'); ?> <?php bloginfo('name'); ?>" />
<meta name="keywords" content="<?php wp_title(); echo ' , '; bloginfo( 'name' ); ?>" />
<meta name="description" content="<?php wp_title(); echo ' | '; bloginfo( 'description' ); ?>" />


ทำให้เครื่องหมาย >> หายไป
<meta name="keywords" content="<?php wp_title(''); echo ' , '; bloginfo( 'name' ); ?>"/>
<meta name="description" content="<?php wp_title(''); echo ' | '; bloginfo( 'description' ); ?>"/>



"If this is a single post view, show the post title; if this is a multi-post view, show the blog name and description."

<meta name="description" content="<?php if ( is_single() ) {
        single_post_title('', true);
    } else {
        bloginfo('name'); echo " - "; bloginfo('description');
    }
    ?>" />


อื่นๆ
<title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>

<title><?php if(is_home()) { echo bloginfo("name"); echo " | "; echo bloginfo("description"); } else { echo wp_title(" | ", false, right); echo bloginfo("name"); } ?></title>

http://bavotasan.com/2008/how-to-modify-your-wordpress-title-tag-for-search-engine-optimization/

อื่นๆ
<?php if (is_single() && in_category('1')) { ?>
<meta name="description" content="<?php the_title();?>"/>
<?php } ?>


<?php if is_single(array( 41,48,103,152 )) { ?>
<meta name="description" content="<?php the_title();?>"/>
<?php } ?>


<?php if (is_category()) {
$cat = get_query_var('cat');
$metacat= strip_tags(category_description($cat));?>
<meta name="description" content="<?php echo $metacat;?>"/>
<?php } ?>



excerpt show on meta
<?php if (is_single() || is_page() ) : if (have_posts() ) : while (have_posts() ) : the_post(); ?>
<meta name="description" content="<?php echo get_the_excerpt();?>">
<?php endwhile; endif; elseif (is_home() ): ?>
<meta name="description" content="<?php bloginfo('description'); ?>- AND ADD SOME MORE CONTENT HERE">
<?php endif; ?>


http://www.davidtiong.com/adding-meta-description-to-wordpress-pages-without-a-plugin/

หรือ
<?php
$desc;
if ( is_single() ) {
$desc = get_the_excerpt();
}
elseif ( is_page() ) {
$desc = get_the_excerpt();
}
elseif ( is_category() ) {
$desc = category_description();
}
elseif ( is_home() ) {
$desc = get_bloginfo('description');
}
$desc = htmlspecialchars(trim(strip_tags($desc)));
if (!empty($desc)) {
echo '<meta name="description" content="';
echo $desc;
echo '"/>';
}
?>

http://fransdejonge.com/2012/04/using-wordpress-excerpts-in-meta-description/

<?php if (is_single() || is_page() ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<meta name="description" content="<?php the_excerpt_rss(); ?>" />
<?php endwhile; endif; elseif(is_home()) : ?>
<meta name="description" content="<?php bloginfo('description'); ?>" />
<?php endif; ?>


หรือ

<?php
if (is_singular()):
global $post;
setup_postdata($post);
?>
<meta name=”description” content=”<?php the_excerpt_rss(); ?>” />
<?php endif; ?>


ID=2666,MSG=3280
Re: WP ใส่ keyword , description

Re: WP ใส่ keyword , description

ใช้คู่กับ
functions.php

function custom_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );


Control Excerpt Length using Filters
By default, excerpt length is set to 55 words. To change excerpt length to 20 words using excerpt_length filter, add the following code to functions.php file in your theme

https://codex.wordpress.org/Function_Reference/the_excerpt


ID=2666,MSG=3282


⭐️ เราให้คำแนะนำปรึกษา รักษาผลประโยชน์ให้ลูกค้า ของเรา
⭐️ เราอยู่เคียงข้างลูกค้าของเรา ช่วยเหลือ ดูแลบริการ
⭐️ เรารองรับช่องทางติดต่อมากมาย สะดวก เข้าถึงง่าย
⭐️ เราดำเนินธุรกิจยาวนานกว่า20 ปี คุณจึงมั่นใจได้
⭐️ คุณมีสามารถรับบริการทั้งจากบริษัทประกันเจ้าของสินค้า และ เรา (ตัวกลาง)

ไทย มีราว 80 บริษัทประกันภัย สินค้าที่แตกต่าง ทั้ง เงื่อนไข ราคา เคลม ความมั่นคง นโยบาย ฯลฯ
ขายผ่านตัวกลาง กว่า 500,000 ราย : ตัวแทน นายหน้า ธนาคาร บิ๊กซี โลตัส ค่ายรถยนต์ เฮ้าส์แบรนด์ ของประกันภัย หรือ ซื้อตรงกับบริษัทเจ้าของสินค้า
⭐️ ตัวอย่าง การบริการ กดดูที่ลิงค์นี้

"สิ่งที่ต้องคำนึงอันดับแรกในการซื้อประกัน คือ ตัวกลางประกันภัย ซึ่งจะเป็นที่ปรึกษา ช่วยเหลือ ดูแลเรา ตลอดอายุกรมธรรม์"

โปรดรอ

display:inline-block; position:relative;
โทร.(จ-ศ : 9-16) เว้นวันหยุดฯ , ลูกค้าเรา บริการ 24/7/365 , Monday เวลา 02:18:45am ...
Copyright © 2018 Cymiz.com., All rights reserved.นโยบาย,ข้อตกลงcymiz.com