How to show custom field, meta field… of the current post?

Content Views Pro helps you to show custom field, meta field… of current post in single post page with below steps:

  1. create a new View, select custom fields and meta fields you want to show.
  2. add shortcode to current post in its page.
    • To show for specific posts only, please edit these posts, then add below shortcode to text editor:
      [pt_view id="VIEW_ID" post_id="GET_CURRENT"]
      
    • To show for each of all posts, please add this code to file functions.php in the theme’s folder (or install this plugin Code Snippets then add this code to the “Code” textarea):
      // Content Views Pro - show related posts for each post
      add_filter( 'the_content', 'cvp_theme_show_info_of_current_post', 999 );
      function cvp_theme_show_info_of_current_post( $content ) {
      	if ( is_single() ) {
      		ob_start();
      		echo do_shortcode( '[pt_view id="VIEW_ID" post_id="GET_CURRENT"]' );
      		$content .= ob_get_clean();
      	}
      	return $content;
      }
      
    • Replace VIEW_ID in above code with ID of the View in step 1

Best regards,