Php 我如何拉后和页面

Php 我如何拉后和页面,php,wordpress,posts,Php,Wordpress,Posts,我已经在我的网站上启用了页面类别,我正在尝试同时获取页面和帖子。我该怎么做?如果我去掉“post_type”=>“page”,它默认为posts only <ul class="list-item"> <?php // Set up the arguments for retrieving the pages $args = array(

我已经在我的网站上启用了页面类别,我正在尝试同时获取页面和帖子。我该怎么做?如果我去掉“post_type”=>“page”,它默认为posts only

<ul class="list-item">   

                <?php
                // Set up the arguments for retrieving the pages
                $args = array(
                    'post_type' => 'page',
                    'numberposts' => -1,
                    'post_status' => null,
                // $post->ID gets the ID of the current page
                'category' => 126,
                    'order' => ASC,
                    'orderby' => title
                    );
                 $subpages = get_posts($args);
                 // Just another WordPress Loop
                 foreach($subpages as $post) :
                    setup_postdata($post);
                 ?>

                <li>
                    <a href="<?php the_permalink(); ?>">
                        <img src="<?php echo gangmei_get_the_post_thumbnail_url($post->ID, 'large'); ?>" alt="image" />
                        <span class="holder">
                            <h2><?php the_title(); ?></h2>
                            <span class="postmeta"><?php echo 'The post type is: '.get_post_type( $post->ID ); ?>, <?php the_date(); ?></span>
                            <span class="txt"><?php the_excerpt_rss(); ?></span>
                        </span>
                        <span class="mask-1">mask</span>
                        <span class="mask-2">mask</span>
                    </a>
                </li>



            <?php endforeach; ?> 
            </ul>

任何帮助都将不胜感激!谢谢在低质量帖子评论中查看此答案。请看。
'post_type' => array ('post', 'page')