{"id":1441,"date":"2017-03-09T12:28:30","date_gmt":"2017-03-09T12:28:30","guid":{"rendered":"http:\/\/docs.contentviewspro.com\/?p=1441"},"modified":"2023-12-29T03:36:39","modified_gmt":"2023-12-29T03:36:39","password":"","slug":"show-custom-field-meta-field-current-post","status":"publish","type":"docs","link":"https:\/\/contentviewspro.com\/documentation\/article\/show-custom-field-meta-field-current-post\/","title":{"rendered":"Show custom field, meta field&#8230; of the current post\/page"},"content":{"rendered":"<p>Content Views Pro helps you to show custom field, meta field\u2026 of current post in single post page with 2 steps:<\/p>\n<ol>\n<li>create a new View, <a href=\"https:\/\/contentviewspro.com\/documentation\/article\/how-to-show-wordpress-custom-field\/\">select custom fields<\/a> and meta fields you want to show.<br \/>\n<br \/>\nEspecially, you might need to select the option <code>All \/ Multi post types<\/code> for Filter Settings > Content Type to match the post type correctly and automatically.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/contentviewspro.com\/documentation\/wp-content\/uploads\/2017\/03\/Show-all-post-types.png\" alt=\"\" width=\"636\" height=\"165\" class=\"alignnone size-full wp-image-4120\" srcset=\"https:\/\/contentviewspro.com\/documentation\/wp-content\/uploads\/2017\/03\/Show-all-post-types.png 636w, https:\/\/contentviewspro.com\/documentation\/wp-content\/uploads\/2017\/03\/Show-all-post-types-300x78.png 300w\" sizes=\"auto, (max-width: 636px) 100vw, 636px\" \/>\n<\/li>\n<li>show the View:\n<ul style=\"margin-top:15px\">\n<li>To show for specific posts only, please edit these posts, then add below shortcode to text editor:\n<pre style=\"font-size:13px\">\n&#91;pt_view id=\"VIEW_ID\" post_id=\"GET_CURRENT\"&#93;\n<\/pre>\n<\/li>\n<li>To show for each of all posts, please add this code to file <strong>functions.php<\/strong> in the theme&#8217;s folder (or install this plugin <a href=\"https:\/\/wordpress.org\/plugins\/code-snippets\/\" rel=\"nofollow\">Code Snippets<\/a> then add this code to <a href=\"https:\/\/ps.w.org\/code-snippets\/assets\/screenshot-2.png\" rel=\"nofollow\">the &#8220;Code&#8221; textarea<\/a>):\n<pre style=\"font-size:13px\">\n\/\/ Content Views Pro - show related posts for each post\nadd_filter( 'the_content', 'cvp_theme_show_info_of_current_post', 999 );\nfunction cvp_theme_show_info_of_current_post( $content ) {\n\tif ( is_single() ) {\n\t\tob_start();\n\t\techo do_shortcode( '&#91;pt_view id=\"VIEW_ID\" post_id=\"GET_CURRENT\"&#93;' );\n\t\t$content .= ob_get_clean();\n\t}\n\treturn $content;\n}\n<\/pre>\n<\/li>\n<\/ul>\n<p>Please replace <strong>VIEW_ID<\/strong> in above code with <a href=\"https:\/\/contentviewspro.com\/documentation\/article\/what-is-id-of-a-view\/\">ID of the View<\/a> in step 1.<\/p>\n<\/li>\n<\/ol>\n<p>Best regards,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Content Views Pro helps you to show custom field, meta field\u2026 of current post in single post page with 2 steps: create a new View, select custom fields and meta fields you want to show. Especially, you might need to select the option All \/ Multi post types for Filter Settings > Content Type to &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/contentviewspro.com\/documentation\/article\/show-custom-field-meta-field-current-post\/\"> <span class=\"screen-reader-text\">Show custom field, meta field&#8230; of the current post\/page<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"doc_category":[52,9],"doc_tag":[13,30],"class_list":["post-1441","docs","type-docs","status-publish","hentry","doc_category-custom-field","doc_category-how-to","doc_tag-custom-field","doc_tag-meta-fields"],"year_month":"2026-09","word_count":192,"total_views":"3","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"admin1","author_nicename":"admin1","author_url":"https:\/\/contentviewspro.com\/documentation\/author\/admin1\/"},"doc_category_info":[{"term_name":"Custom Field (core, ACF, Metabox, etc.)","term_url":"https:\/\/contentviewspro.com\/documentation\/cats\/custom-field\/"},{"term_name":"How To","term_url":"https:\/\/contentviewspro.com\/documentation\/cats\/how-to\/"}],"doc_tag_info":[{"term_name":"custom field","term_url":"https:\/\/contentviewspro.com\/documentation\/tags\/custom-field\/"},{"term_name":"meta fields","term_url":"https:\/\/contentviewspro.com\/documentation\/tags\/meta-fields\/"}],"_links":{"self":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/1441","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/comments?post=1441"}],"version-history":[{"count":2,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/1441\/revisions"}],"predecessor-version":[{"id":5607,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/1441\/revisions\/5607"}],"wp:attachment":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/media?parent=1441"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_category?post=1441"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_tag?post=1441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}