I create custom post type "portfolio" and create custom meta box with value key "_portfolio_name_value_key". but when I try to retrieve the saved value in frontend it did not show.
i used this code:
<?php get_post_meta( $post->ID, '_portfolio_name_value_key' ); ?>
in single-portfolio.php page,
however title, featured image, custom taxonomy and content had no problem displaying. Here is full code I used:
<?php
if ( have_posts() ) :
while ( have_posts() ) : the_post(); ?>
<div class=row>
<div class="col-xs-12 col-md-8 col-sm-8">
<div class="owl-carousel owl-theme project-detail-carousel"id=project_detail>
<div class=project-detail-item><img alt=p-detail src="<?php the_post_thumbnail(''); ?>"></div>
</div>
</div>
<div class="col-xs-12 col-sm-4 col-md-4">
<div class=project-detail-1>
<h2><?php the_title(); ?></h2>
<ul>
<li><span>Client:</span><?php get_post_meta( $post->ID, '_portfolio_name_value_key' ); ?>
<li><span>Category:</span> <?php the_terms( $post->ID, 'field' ); ?>
<li><span>Status:</span> <?php get_post_meta( $post->ID, '_portfolio_status_value_key' ); ?>
<li><span>Tags:</span> <?php the_terms( $post->ID, 'ptag' ); ?>
<li><span>Date:</span> <?php get_post_meta( $post->ID, '_portfolio_date_value_key' ); ?>
</ul>
</div>
</div>
</div>
<div class="row mt-50">
<div class=col-md-12>
<div class=project-detail-1-info>
<h3>A little About This Project</h3>
<div class=text-content>
<?php the_content(); ?>
</div>
</div>
</div>
</div>
<?php
endwhile;
endif;
?>