使用Thesis Theme在Wordpress 3.2中将数字页面ID作为变量获取

时间:2011-07-08 10:40:17

标签: wordpress wordpress-thesis-theme

我发现答案是忽略了将$ post放在我的职能范围内

我需要将页面ID作为变量获取,以便我可以在switch语句中使用它来实现各种目的。

我正在使用WP 3.2 + Thesis 1.8 - 所有品牌都是新的。

我尝试过各种不同的代码,这些代码在WP 2.9中运行标准主题但没有运气。

我用于此的任何代码都将用wp-content \ themes \ thesis_182 \ custom \ custom_functions.php

编写

1 个答案:

答案 0 :(得分:0)

为什么需要page_id?你可以检查一下

if ( is_page(<page_id>) ) {
.....
....
}