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

wordpress 插件 文章 2020-03-09 07:10 515 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插件] Default Post Date and Time默认发布日期和时间
[wordpress插件] All Mime Type Options所有Mime类型选项
[wordpress插件] Common Links常用链接
[wordpress插件] BotBanish by Randem SystemsBotBanish by Randem Systems
[wordpress插件] Cotton Framework棉花框架
随便看看
怎么添加小程序支付功能? 4516
教育科技公司申请微信支付被拒绝? 4799
微信公众号免300认证教程 5892
小程序已经上线,作为管理员无法在小程序数据助手查看数据? 5299
小程序广告组件通过审核,但是小程序内没有显示广告? 5067
企业微信通讯录账号被管理员误/恶意删除,怎么办? 9568
问题? 9048
如何快速搭建抽奖助手小程序(无需代码知识) 6177
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 7472
小程序搜一搜全称搜索不显示 麻烦解决一下!谢谢 6793