Php 如何在显示默认帖子时显示自定义帖子wordpress?

Php 如何在显示默认帖子时显示自定义帖子wordpress?,php,wordpress,Php,Wordpress,我正在尝试显示新的自定义帖子和默认帖子。 如何显示两篇文章(默认,我的自定义文章) 但是现在只显示了一篇文章。这就是在wordpress中显示自定义文章的方式 <?php $type = 'my_custom_post'; $args=array( 'post_type' => $type, 'post_status' => 'publish', 'posts_per_page' => -1, 'call

我正在尝试显示新的自定义帖子和默认帖子。 如何显示两篇文章(默认,我的自定义文章)



但是现在只显示了一篇文章。

这就是在wordpress中显示自定义文章的方式

<?php
    $type = 'my_custom_post';
    $args=array(
      'post_type' => $type,
      'post_status' => 'publish',
      'posts_per_page' => -1,
      'caller_get_posts'=> 1

    $my_query = null;
    $my_query = new WP_Query($args);
    if( $my_query->have_posts() ) {
      while ($my_query->have_posts()) : $my_query->the_post(); ?>
        <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
        <?php
      endwhile;
    }
    wp_reset_query();  // Restore global post data stomped by the_post().
    ?>

这是在wordpress中显示自定义帖子的方式

<?php
    $type = 'my_custom_post';
    $args=array(
      'post_type' => $type,
      'post_status' => 'publish',
      'posts_per_page' => -1,
      'caller_get_posts'=> 1

    $my_query = null;
    $my_query = new WP_Query($args);
    if( $my_query->have_posts() ) {
      while ($my_query->have_posts()) : $my_query->the_post(); ?>
        <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
        <?php
      endwhile;
    }
    wp_reset_query();  // Restore global post data stomped by the_post().
    ?>

你所说的“默认”帖子是什么意思?在自定义页面上显示的帖子..换句话说,在仪表板中默认显示的帖子。你所说的“默认”帖子是什么意思?在自定义页面上显示的帖子..换句话说,在仪表板中默认显示的帖子。