Answer the question
In order to leave comments, you need to log in
How to display custom post type and custom fields on my page?
I created my own "record type", added my own custom fields. How to display the entire post with performance fields on your page without using "single.php". Need code on how to do it.
Answer the question
In order to leave comments, you need to log in
So create single-posttype.php where posttype is your post type. And in it already display the fields as you like.
Created single-"my post type".php. I am writing this code.
<?php
$card = new WP_Query( array( 'post_type' => 'card') );
if ( $card->have_posts() ) :
while ( $card->have_posts() ) : $card->the_post(); ?>
<div class="card">
<h2><?php the_title(); ?></h2>
<p><? the_content(); ?></p>
</div>
<?php endwhile; ?>
<?php endif; ?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question