WordPress编辑php get_template_part()和get_post_format()函数

WordPress编辑php get_template_part()和get_post_format()函数,php,wordpress,Php,Wordpress,我只想加载没有标题、日期、评论等信息的帖子内容。有没有一种方法可以抓住这个职位 <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php endif; ?>

我只想加载没有标题、日期、评论等信息的帖子内容。有没有一种方法可以抓住这个职位

<?php if ( have_posts() ) : ?>
   <?php while ( have_posts() ) : the_post(); ?>
   <?php get_template_part( 'content', get_post_format() ); ?>
   <?php endwhile; ?>
<?php endif; ?>

只需更换:

    <?php get_template_part( 'content', get_post_format() ); ?>

与:


前者是在主题根目录中查找类似content status.phpcontent aside.php的内容,或者最有可能的情况是,在普通的“post”中,查找content.php

 <?php get_template_part( 'content', get_post_format() ); ?>


并编辑一份名为
content myformat.php
content page.php
副本,从中可以删除
标题()

 <?php get_template_part( 'content', get_post_format() ); ?>
 <?php get_template_part( 'content', 'myformat' ); ?>