{"id":3234,"date":"2018-08-09T03:49:11","date_gmt":"2018-08-09T03:49:11","guid":{"rendered":"https:\/\/docs.contentviewspro.com\/?p=3234"},"modified":"2023-12-27T09:54:38","modified_gmt":"2023-12-27T09:54:38","password":"","slug":"show-custom-field-show-info-acf-post-object","status":"publish","type":"docs","link":"https:\/\/contentviewspro.com\/documentation\/article\/show-custom-field-show-info-acf-post-object\/","title":{"rendered":"Show more information of ACF post object custom field"},"content":{"rendered":"<p>Content Views Pro helps you to show custom fields easily.<br \/>\nWhen showing a <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/post-object\/\" rel=\"noopener nofollow noreferrer\" target=\"_blank\">post object custom field<\/a> of the Advanced Custom Fields plugin, Content Views Pro will show the title of the object by default.<br \/>\nTo show more info of the object, 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>):<\/p>\n<pre style=\"font-size:13px\">\nadd_filter( 'pt_cv_acf_post_object_html', 'cvp_theme_acf_post_object_html', 100, 2 );\n\/**\n * Content Views Pro - show more info of ACF post object\n * @param string $args The output of this ACF field (default output is the post title)\n * @param object $post The post object\n * @return string\n *\/\nfunction cvp_theme_acf_post_object_html( $args, $post ) {\n\tglobal $pt_cv_id;\n\tif ( $pt_cv_id === 'VIEW_ID' ) {\n\t\t\/\/ For example: show thumbnail before title\n\t\t$args = get_the_post_thumbnail( $post->ID ) . $args;\n\t}\n\n\treturn $args;\n}\n<\/pre>\n<p>(replace <strong>VIEW_ID<\/strong> with <a href=\"https:\/\/contentviewspro.com\/documentation\/article\/what-is-id-of-a-view\/\">ID of your View<\/a>)<\/p>\n<p>Best regards,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Content Views Pro helps you to show custom fields easily. When showing a post object custom field of the Advanced Custom Fields plugin, Content Views Pro will show the title of the object by default. To show more info of the object, please add this code to file functions.php in the theme&#8217;s folder (or install &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/contentviewspro.com\/documentation\/article\/show-custom-field-show-info-acf-post-object\/\"> <span class=\"screen-reader-text\">Show more information of ACF post object custom field<\/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],"doc_tag":[21],"class_list":["post-3234","docs","type-docs","status-publish","hentry","doc_category-custom-field","doc_tag-custom-code"],"year_month":"2026-09","word_count":161,"total_views":"1","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\/"}],"doc_tag_info":[{"term_name":"custom PHP code","term_url":"https:\/\/contentviewspro.com\/documentation\/tags\/custom-code\/"}],"_links":{"self":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/3234","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=3234"}],"version-history":[{"count":1,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/3234\/revisions"}],"predecessor-version":[{"id":5391,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/3234\/revisions\/5391"}],"wp:attachment":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/media?parent=3234"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_category?post=3234"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_tag?post=3234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}