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天的文章中展示广告》的一些看法。更多内容请查看本栏目更多内容!
我网上找了很多处理导航计划的成绩,均无奈用于WordPress3.1之上,总会呈现其余成绩。而我所解说的这种办法...
要求 如,在桌面设施上,图片应用的是以下的HTML代码: 复制代码代码如下: <img src="abc.png" alt="abc" w...
wp_title 函数在 WordPress 中是用来显示文章、页面、分类等等等等题目的一个函数,但在首页索引,该函数将...
comments_template comments_template 函数是一个调用评论模板的函数,应用起来很简略,与get_header()等函...
通常咱们喜爱应用Wordpress Thread Comment 或 Mail To Commenter这两款插件前者久未更新,已测支持WordPre...
本文实例讲述了wordpress主题评论中增加回复的办法。分享给大家供大家参考。详细如下: 很多冤家要给本人主...