Polaroid
Hãy nhanh tay Đăng kí và Đăng nhập để trở thành thành viên chính thức của LapTool.Wap.Sh và cùng thảo luận!
» » » Tối ưu thẻ meta keywords, description
(Theo dõi chủ đề)

Bài viết: Tối ưu thẻ meta keywords, description

Forum LapTool.Wap.Sh..! ↑ ↓
vuvanhoan * vuvanhoan (Admin) [Off]
* 11-11-2016

Demo: http://wmvn.hexat.com/menu/blog.html...000001#xt_blog (viewsource mới hiểu)
Code này mình làm nó sẽ tự động get thẻ meta keywords, description . Đảm bảo chuẩn và hợp lệ cho anh em

<!--parser:xtscript-->
var $blog = <xt:blog tzone="7" display="1" entries_per_page="10" comments_per_page="20" comments_sort="-1" display_limit="50" display_symbol="..." version="2" t_back_to_posts="" t_comments="" t_post_a_comment="" t_name="" t_comment="" t_post="" />
var $daut = call strrpos $haystack=$blog;$needle=<div class="xt_blog_content">
var $cuoit = call strrpos $haystack=$blog;$needle=</div>
if $daut > 0
var $noidung = call substr $val=$blog;$start=($daut+29);$length=($cuoit-29-$daut)
var $des = call substr $val=$noidung;$start=0;$length=136
var $des = call strip_tags $val=$des 
var $des = call htmlspecialchars $val=$des
var $spc = call chr $val=32
var $key = call str_replace $subject=$des;$search=$spc;$replace=,
var $key = call str_replace $subject=$key;$search=.;$replace=,
endif
print <meta name="description" content="$des" /><meta name="keywords" content="$key" />
<!--/parser:xtscript-->

Đặt code trên vào giữa cặp thẻ <head>...</head>

(0)
- Tổng số 1 bình luận và lượt xem
Công cụ bài viết

Online: [0]Khách: [1]
C-STAT
LapTool.Wap.Sh..!Thiết kế bởi SINO-
-->