外贸独立站的底层设计密码WordPress 成品站SaaS建站
当前位置:首页>WordPress建站>WordPress开发>WordPress函数:get_boundary_post(获取边界文章)

WordPress函数:get_boundary_post(获取边界文章)

Description【描述】

Get the first or last post by publish date【根据发布日期获取第一篇或最后一篇文章】

Usage【用法】

<?php get_boundary_post( $in_same_cat, $excluded_categories, $start ); ?>

Parameters【参数】

$in_same_cat
(boolean) (optional) Whether post should be in same category. 【(布尔值)(可选)文章是否在同一分类】

Default: false【默认:false】
$excluded_categories
(string) (optional) Excluded categories IDs. 【(字符串)(可选)排除分类的ID】

Default: ”【默认:”】
$start
(boolean) (optional) True to begin at the beginning【(布尔值)(可选)在开始时开始】

Default: true 【默认:true】

Return Values【返回值】

  • Post object if successful. 【如果成功,返回文章对象】
  • Null if global $post is not set. 【如果全局的 $post 没有设置,返回空值】
  • Empty string if no corresponding post exists.【如果不存在符合条件的文章,返回空字符串】

Examples【例子】

Notes【注释】

get_boundary_post() will set the post pointer to the first post.【get_boundary_post() 将设置文章指向第一篇文章】

Change Log【更改日志】

Since: 2.8.0【从 2.8.0 开始】

Source File【源文件】

get_boundary_post() is located in wp-includes/link-template.php.【get_boundary_post() 函数在wp-includes/link-template.php 中】

参考资料:http://codex.wordpress.org/Function_Reference/get_boundary_post

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

给TA打赏
共{{data.count}}人
人已打赏
欢迎关注WordPress大学公众号 WPDAXUE
WordPress开发

WordPress函数:get_adjacent_post(获取相邻文章)

2013-3-21 6:05:00

WordPress开发

WordPress函数:get_children (获取子对象)

2013-3-21 7:04:00

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索