function is_old_post($post_id=null){
$days = 15;
global $wp_query;
if(is_single() || is_page()) {
if(!$post_id) {
$post_id = $wp_query->post->ID;
}
$current_date = time();
$offset = $days *60*60*24;
$post_id = get_post($post_id);
$post_date = mysql2date('U',$post_id->post_date);
$cunning_math = $post_date + $offset;
$test = $current_date - $cunning_math;
if($test > 0){
$return = true;
}else{
$return = false;
}
}else{
$return = false;
}
return $return;
}
< ?php if(is_old_post()){ ?>
INSERT AD CODE HERE
< ?php } ?>
以上就是安达网络工作室关于《WordPress 发布时间超过15天的文章中展示广告》的一些看法。更多内容请查看本栏目更多内容!
Fatal error: Call to undefined method wpdb_2::delete() in /home/*/public_html/wp-includes/o...
WordPress 3.0 引入导航菜单性能, 让页面的导航和链接的治理变得简略易用. WP 向用户提供了菜单治理页面和多...
要害字形容:教程 治理 用户 权限 能够 编辑 注册 Wordpress 咱们 后面咱们讲述了 Wordpress 插件的应用。...
说到wordpress搬家,置信大局部wp玩家还是可以轻松处理成绩,可是关于老手置信会遇到不少费事成绩吧,上面跟...
缺点文件/{Path}/wp-includes/registration-functions.php 要害代码: —-> <?php /** * Deprecated. N...
1、修正文章页面模板single.php关上模版文件中的single.php,在其中搜寻在这行上面加上:复制代码代码如下:...