Answer the question
In order to leave comments, you need to log in
How to display additional fields (meta box) on my single-"".php?
I created my own "Post Type" in the functions.php file, in the new "Post Type" I created an area with various add. fields ("text", "Picture", "Text area"). Everything in the new "record type" was displayed.
When publishing your "post type", the main content displays, and does not display additional content. fields on single-"...".php
How to display additional fields on the page on single-"...".php???
Or tell me where to dig :)
I use this code:
$card = new WP_Query( array( 'post_type' => 'card') );
if ( $card->have_posts() ) :
while ( $card->have_posts() ) : $card->the_post(); ?>
<?php the_title(); ?>
<?php the_content(); ?>
<?php echo get_post_meta(post->ID(), 'id-моего доп. поля', true); ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question