php Wordpress查询字符串使用瞬态API

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php Wordpress查询字符串使用瞬态API相关的知识,希望对你有一定的参考价值。

<?php
// Get any existing copy of our transient data
if ( false === ( $special_query_results = get_transient( 'special_query_results' ) ) ) {
    // It wasn't there, so regenerate the data and save the transient
     $special_query_results = new WP_Query( 'cat=5&order=random&tag=tech&post_meta_key=thumbnail' );
     set_transient( 'special_query_results', $special_query_results );
}
// Use the data like you would have normally...
?>

以上是关于php Wordpress查询字符串使用瞬态API的主要内容,如果未能解决你的问题,请参考以下文章