Как выборочно отображать страницы на боковой панели?У меня есть несколько страниц, которые я хочу отобразить, и некоторые страницы, которые я не хочу.В частности, у меня есть несколько страниц, которые просто информируют пользователя после успешной регистрации, и я не хочу отображаться на боковой панели.Я использовал WordPress для генерации PHP с этим кодом
<div id="primary" class="widget-area">
<?php get_search_form(); ?>
<ul class="xoxo">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
<li id="pages" class="widget-container">
<h3 class="widget-title"><?php _e('Site Map'); ?></h3>
<ul>
<?php
//code that works as it is
wp_list_pages( 'sort_column=menu_order&title_li=&deprth=1');
//code that i produced and not works as excepected
$top_pages_to_exclude = '2, 94, 100, 123, 125, 127';
$args = array
(
'sort_column' => 'menu_order',
'title_li' => '',
'deprth' => 1,
'exclude_tree' => $top_pages_to_exclude
);
wp_list_pages( $args);
///////////////////////////////////////////////////////////
?>
</ul>
</li>
<li id = "register" class = "widget-container">
<h3 class = "widget-title"> <?php _e('Register / Log in '); ?></h3>
<form name="login" action="" method="get">
To <a href="http://localhost/bill/?page_id=74">Register</a>
<br/>
<hr/>
Username   <input type="text" name="user" width="200" height="20" />
<br/>
<br/>
Password   <input type="password" name="pwd" width="200" height="20" />
<br/>
<br/>
<input type="submit" value="Log In" />
</form>
</li>
<!-- <li id="comments" class="widget-container">
<h3 class="widget-title"><?php _e('Recent Comments'); ?></h3>
<?php $comments = get_comments('number=5&status=approve'); ?>
<ul>
<?php foreach ($comments as $comment) : ?>
<?php $the_post = get_post($comment->comment_post_ID); ?>
<li>
<?php echo $comment->comment_author; ?> on <a href="<?php echo get_comment_link($comment); ?>"><?php echo $the_post->post_title; ?></a>
</li>
<?php endforeach; ?>
</ul>
</li>
<li id="categories" class="widget-container">
<h3 class="widget-title"><?php _e('Categories'); ?></h3>
<ul>
<?php wp_list_categories('title_li='); ?>
</ul>
</li>
<li id="links" class="widget-container">
<h3 class="widget-title"><?php _e('Links'); ?></h3>
<ul>
<?php wp_list_bookmarks('title_li=&categorize=0'); ?>
</ul>
</li>
<li id="archives" class="widget-container">
<h3 class="widget-title"><?php _e('Archives'); ?></h3>
<ul>
<?php wp_get_archives('type=monthly'); ?>
</ul>
</li>
<li id="meta" class="widget-container">
<h3 class="widget-title"><?php _e('Register'); ?></h3>
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<?php wp_meta(); ?>
</ul>
</li>
<li id="rss" class="widget-container">
<a href="<?php bloginfo('rss2_url'); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/rss-icon.png" width="18px" height="18px" /></a> <span class="rss">Subscribe via <a href="<?php bloginfo('rss2_url'); ?>">RSS</a></span>
</li>
-->
<?php endif; ?>
</ul>
</div>