просто интересно, будет ли лучше использовать что-то вроде get_pages () вместо создания нового wp_query ()?
используя этот маленький кусочек кода, вы можете создать список страниц, которые вы хотите ..
<ul>
<?php $special_tabs = get_pages ('sort_column=post_title&echo=0&include=2,3,4&title_li='); ?>
<?php
foreach ($special_tabs as $tab) {
$title = $tab->post_title;
echo "<li>".$title."</li>";
}
?>
</ul>
если вы сделаете print_r для переменной $ special_tab, вы получите следующий массив
<code></php
echo"<pre>";
echo print_r($special_tabs);
echo"
";
?>
массив
(
[0] => stdClass Object
(
[ID] => 2
[post_author] => 1
[post_date] => 2010-03-24 15:26:18
[post_date_gmt] => 2010-03-24 15:26:18
[post_content] => Это пример страницы WordPress.
[post_title] => О
[post_excerpt] =>
[post_status] => опубликовать
[comment_status] => открыть
[ping_status] => открыть
[post_password] =>
[post_name] => о
[to_ping] =>
[pinged] =>
[post_modified] => 2010-03-24 15:26:18
[post_modified_gmt] => 2010-03-24 15:26:18
[post_content_filtered] =>
[post_parent] => 0
[guid] =>
http://example.com/about/
[menu_order] => 0
[post_type] => страница
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
)
[1] => stdClass Object
(
[ID] => 3
[post_author] => 1
[post_date] => 2010-03-27 10:48:29
[post_date_gmt] => 2010-03-27 10:48:29
[post_content] =>
[post_title] => testpage1
[post_excerpt] =>
[post_status] => опубликовать
[comment_status] => открыть
[ping_status] => открыть
[post_password] =>
[post_name] => testpage1
[to_ping] =>
[pinged] =>
[post_modified] => 2010-03-27 10:48:29
[post_modified_gmt] => 2010-03-27 10:48:29
[post_content_filtered] =>
[post_parent] => 0
[guid] =>
http://example.com/testpage1/
[menu_order] => 0
[post_type] => страница
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
)
[2] => stdClass Object
(
[ID] => 4
[post_author] => 1
[post_date] => 2010-03-27 10:56:26
[post_date_gmt] => 2010-03-27 10:56:26
[post_content] =>
[post_title] => testpage2
[post_excerpt] =>
[post_status] => опубликовать
[comment_status] => открыть
[ping_status] => открыть
[post_password] =>
[post_name] => testpage2
[to_ping] =>
[pinged] =>
[post_modified] => 2010-03-27 10:56:26
[post_modified_gmt] => 2010-03-27 10:56:26
[post_content_filtered] =>
[post_parent] => 0
[guid] =>
http://example.com/testpage2/
[menu_order] => 0
[post_type] => страница
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
)
)
надеюсь, это то, что вы можете использовать .. :)
просто не забудьте включить идентификатор вашей страницы в раздел get_pages (), вместо 2,3,4, которые уже есть ...
ref: http://codex.wordpress.org/Function_Reference/get_pages