【发布时间】:2010-11-24 13:48:44
【问题描述】:
我正忙于为一位客户构建一个小型主题选项页面,需要一些帮助来解决问题。
目前我可以选择手动输入 wordpress 页面的 IDS 以使用 query_posts 提取数据
基于主题选项创建一个名为$euro_box_1_vehicles;的变量
我的选项在输入中填写为32,39,43,54,当我用echo打印这个语句时,我得到了相同的结果。
当我将array(32,39,43,45) 替换为array($euro_box_1_vehicles) 时,它只返回一个结果。
<?php
$vehicle1 = array(
'post__in' => array(32,39,43,45),
'post_type' => 'page',
);
query_posts( $vehicle1 );
while (have_posts()) : the_post();
?>
【问题讨论】:
-
试试
var_dump($euro_box_1_vehicles),让我们知道打印的内容。 -
当我回显 var_dump = string(11) "32,39,43,45"
-
@TheDeadMedic,为您添加了结果。
标签: wordpress wordpress-theming