Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WordPress editing php get_template_part() and get_post_format() function

Tags:

php

wordpress

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; ?>
like image 708
acctman Avatar asked Dec 05 '22 16:12

acctman


1 Answers

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.

like image 109
Foxinni Avatar answered Mar 09 '23 01:03

Foxinni