[wordpress插件] Boone's Pagination布恩的分页

wordpress 插件 文章 2020-03-09 07:10 457 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

Here’s how I recommend using the class.

这是我推荐使用该课程的方式。

    1. Either activate this plugin, or include the class in your own plugin file.
    2. 要么激活此插件,要么将类包含在您自己的插件文件中。

    3. When you start to render the page with the post list, instantiate the pagination class, using an argument array if you'd like: $pargs = array( 'get_per_page_key' => 'perpage', 'get_paged_key' => '

    4. 当您开始用帖子列表呈现页面时,请根据需要使用参数数组实例化分页类:$ pargs = array('get_per_page_key'=>'perpage','get_paged_key'=>'

      current_page', 'per_page' => 15 );

      current_page','per_page'=> 15);

      $pagination = new BBG_CPT_Pag( $args );

    5. $ pagination = new BBG_CPT_Pag($ args);

    6. When constructing your query arguments (for query_posts() or WP_Query), you can use the class to get your pagination arguments out of the $_GET parameters.

    7. 在构造查询参数(对于query_posts()或WP_Query)时,可以使用该类从$ _GET参数中获取分页参数。

      For instance: $args = array( … ‘posts_per_page’ => $pagination->get_per_page, ‘paged’ => $pagination->get_paged … );

      例如:$ args = array(…'posts_per_page'=> $ pagination-> get_per_page,'paged'=> $ pagination-> get_paged…);

      query_posts( $args );

    8. query_posts($ args);

    9. After firing the query, use the setup_query() method to populate the rest of the class.

    10. 触发查询后,使用 setup_query()方法填充该类的其余部分。

      If you used query_posts(), you don’t need an argument: $pagination->setup_query();

      如果使用 query_posts(),则不需要参数:$ pagination-> setup_query();

      If you use new WP_Query, you’ll have to pass the query object: $my_query = new WP_Query;

      如果您使用 new WP_Query ,则必须传递查询对象:$ my_query = new WP_Query;

      $pagination->setup_query( $my_query );

    11. $ pagination-> setup_query($ my_query);

    12. Then you can use all sorts of fun methods, like $pagination->paginate_links();

    13. 然后,您可以使用各种有趣的方法,例如$ pagination-> paginate_links();。

      $pagination->currently_viewing_text();

    14. $ pagination-> currently_viewing_text();

下载地址
https://downloads.wordpress.org/plugin/boones-pagination.1.1.zip
-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
[wordpress插件] WordPress Animation Plugin – Animated EverythingWordPress动画插件–一切都动画化
[wordpress插件] Audit Charitable Donations Plugin审核慈善捐款插件
[wordpress插件] Alterskontrolle.de PluginAlterskontrolle.de插件
[wordpress插件] BP-Rest-EndpointsBP其余端点
[wordpress插件] CloudFlare(R) Cache PurgeCloudFlare(R)缓存清除
随便看看
微信公众号免300认证教程 4965
小程序已经上线,作为管理员无法在小程序数据助手查看数据? 4084
小程序广告组件通过审核,但是小程序内没有显示广告? 4262
企业微信通讯录账号被管理员误/恶意删除,怎么办? 8042
问题? 7267
如何快速搭建抽奖助手小程序(无需代码知识) 5050
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 6007
小程序搜一搜全称搜索不显示 麻烦解决一下!谢谢 5521
我的小程序广告收款主体是个体工商户,每个月邮寄两次发票很是麻烦,我年底的时候打包邮寄一次可以么? 5216
如何解决渲染层网络错误Failed to load media? 16566