首先我们先来解释落地页。任何网页一旦被百度收录,成为百度的索引,就有机会在搜索某种关键词时,在某个位置被百度展示出来。作为搜索结果被展示出来的,就可以算作落地页,也就是用户在搜索结果页点击并实际进入的页面。
published_time:内容发布时间
updated_time:内容更新时间
lrDate_time:内容最新回复时间
代码如下:
/*头条时间因子*/
add_action( 'wp_head', 'toutiao_search_time_factor' );
function toutiao_search_time_factor() {
if ( is_single() || is_page() ) {
echo '<meta property="bytedance:published_time" content="',get_the_time('Y-m-d\TH:i:s+08:00'),'" />',"\r\n";
echo '<meta property="bytedance:updated_time" content="" content="',get_the_modified_time('Y-m-d\TH:i:s+08:00'),'" />',"\r\n";
echo '<meta property="bytedance:lrDate_time content="" content="',get_the_modified_time('Y-m-d\TH:i:s+08:00'),'" />',"\r\n";
}
}
如果有使用wp code 后台直接新建代码片段,位置仅限前端或者head头就行
或者放到 wordpress 建站主题模板的 functions.php 文件中
最后效果如下
THE END
暂无评论内容