PHP 查询职位和缓存查询的简单示例

PHP查询职位和缓存查询感兴趣的小伙伴,下面一起跟随编程之家 jb51.cc的小编两巴掌来看看吧!

/**
 * 查询职位和缓存查询
 *
 * @param 
 * @author 网: www.www.jb51.cc
 **/
$bandeau_post = get_transient('top1_bandeau_post');
if (!is_array($bandeau_post) || count($bandeau_post)==0) {
	$args = array(
		'posts_per_page' => 5
		);
	$bandeau_post = array();
	$bandeau_post = query_posts($args);
	set_transient('top1_bandeau_post',$bandeau_post,60*60*$timeout);
}
foreach($bandeau_post as $post) :
		setup_postdata($post);
// the display code
endforeach;

/***   来自编程之家 jb51.cc(jb51.cc)   ***/

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...