我正在使用WordPress 3.3.2开发一个网站,并将首页和帖子页面设置为使用静态页面。我正在尝试使用wp_nav_menu()
分别用于静态首页和静态贴子页。
我能找到is_front_page()
为了查看首页,在我的头撞了几个小时的WordPress Codex和强大的Google之后,我找不到一个类似的功能或方法来检查用户当前是否在静态帖子页面上。
有人碰到过这个吗?任何帮助都将不胜感激!
我正在使用WordPress 3.3.2开发一个网站,并将首页和帖子页面设置为使用静态页面。我正在尝试使用wp_nav_menu()
分别用于静态首页和静态贴子页。
我能找到is_front_page()
为了查看首页,在我的头撞了几个小时的WordPress Codex和强大的Google之后,我找不到一个类似的功能或方法来检查用户当前是否在静态帖子页面上。
有人碰到过这个吗?任何帮助都将不胜感激!
有两种选择:
// If the current page is the blog posts index,
// but is NOT the site front page
if ( is_home() && ! is_front_page() )
或// If the current page has the ID of the
// page assigned to display the blog posts index
if ( is_page( get_option( \'page_for_posts\' ) )
我整天都在黑客攻击一个自定义的帖子类型搜索/过滤系统。到目前为止,我有:function kdev_property_query($query) { if(isset($_POST[\'rooms_n\'])) $_SESSION[\'rooms_n\'] = $_POST[\'rooms_n\']; if(isset($_POST[\'univer\'])) $_SESSION[\'univer\'] = $_POST[\'univer\']; if(isset($_P