Wordpress get_top_ancestor_id()
2016-04-14 09:59
260 查看
//Get top ancestor function get_top_ancestor_id() { global $post; if($post->post_parent) { $ancestors = array_reverse(get_post_ancestors($post->ID)); return $ancestors[0]; } return $post->ID; }
相关文章推荐
- commons-codec使用介绍
- WEB (CentOS)
- Exception: org.apache.ibatis.builder.xml.IncompleteStatementException: Could not find result map....
- CentOS 7.0系统安装配置图解教程
- yii2 URL重写 nginx的配置
- ssh远程登陆linux显示-bash-4.1$解决方法
- 牛人开发软件-网站收集
- linux下用C语言获取硬盘/SD/FLASH存储容量及使用情况
- Linux系统无法上网解决方案
- linux系统编程:线程原语
- hadoop学习笔记
- nginx “403 Forbidden” 错误的原因及解决办法
- bash脚本笔记随记
- JProfiler监控本地服务程序性能
- linux第四章笔记
- 本地项目的jsp跳转到另外一个网站或项目的jsp
- SHELL笔记之管家
- 安装LINUX后要怎么找回WIN7启动项?
- 《Linux内核设计与实现》第四章读书笔记
- linux进程间通讯学习总结