WordPress editing php get_template_part() and get_post_format() function

I want to load the post content only with no title, date, comment, etc info. Is there a way to grab the post only?

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

Related posts

Leave a Reply

2 comments

  1. Simply replace:

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

    With:

        <?php the_content(); ?>
    

    The former is looking for something like content-status.php or content-aside.php or most likely, in the case of a plain old ‘post’, content.php in your theme root.

  2. You can replace

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

    with

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

    and edit a copy of content-page.php with name content-myformat.php where you can remove the_title() row.