{"id":2123,"date":"2017-09-01T04:45:38","date_gmt":"2017-09-01T04:45:38","guid":{"rendered":"http:\/\/docs.contentviewspro.com\/?p=2123"},"modified":"2024-06-11T03:25:58","modified_gmt":"2024-06-11T03:25:58","password":"","slug":"use-custom-title-posts-view","status":"publish","type":"docs","link":"https:\/\/contentviewspro.com\/documentation\/article\/use-custom-title-posts-view\/","title":{"rendered":"Use custom Title for posts"},"content":{"rendered":"<blockquote><p>This feature only works with PRO version.<\/p><\/blockquote>\n<p>Content Views helps you to show any information of WordPress posts easily: title, content, thumbnail, author, category&#8230; By default, Content Views will display the post&#8217;s title.<\/p>\n<p>To show a custom title for posts in our shortcode\/block (and keep the original post&#8217;s title unchanged), please do as follow:<\/p>\n<ul>\n<li>Add new custom field: with name is <code>cvp_custom_title<\/code> and value is the custom title you want to show (<a href=\"http:\/\/contentviewspro.com\/documentation\/article\/add-new-custom-field-wordpress-post\/\" target=\"_blank\" rel=\"noopener noreferrer\">here is how to add custom field<\/a>)\n<p><img decoding=\"async\" src=\"https:\/\/contentviewspro.com\/documentation\/wp-content\/uploads\/2024\/06\/chrome_Td0CmY9jFq.gif\" \/><\/li>\n<\/ul>\n<div style=\"display:none\">\n<p>If you are using Content Views Pro version &lt;= 5.7.1, it requires another step: please add this code to file <strong>functions.php<\/strong> of your active theme:<\/p>\n<pre style=\"font-size: 13px;\">\/\/ Content Views Pro - Show custom title\nadd_filter( 'pt_cv_field_title_result', 'cvp_theme_replace_title_by_ctf', 100, 3 );\nfunction cvp_theme_replace_title_by_ctf( $title, $fargs, $post ) {\n\t$meta = get_post_meta( $post-&gt;ID );\n\n\t$custom_field = 'cvp_custom_title';\n\tif ( !empty( $meta[ $custom_field ][ 0 ] ) ) {\n\t\t$title = $meta[ $custom_field ][ 0 ];\n\t}\n\n\treturn $title;\n}\n<\/pre>\n<blockquote><p>Notice: If you want to use another custom field to replace post title, please replace <code>cvp_custom_title<\/code> in above code with name of your field.<\/p><\/blockquote>\n<\/div>\n<p>Best regards,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This feature only works with PRO version. Content Views helps you to show any information of WordPress posts easily: title, content, thumbnail, author, category&#8230; By default, Content Views will display the post&#8217;s title. To show a custom title for posts in our shortcode\/block (and keep the original post&#8217;s title unchanged), please do as follow: Add &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/contentviewspro.com\/documentation\/article\/use-custom-title-posts-view\/\"> <span class=\"screen-reader-text\">Use custom Title for posts<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":2,"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":[25],"doc_tag":[21,15],"class_list":["post-2123","docs","type-docs","status-publish","hentry","doc_category-adjustment","doc_tag-custom-code","doc_tag-post-title"],"year_month":"2026-09","word_count":188,"total_views":"2","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"CVP","author_nicename":"cvp","author_url":"https:\/\/contentviewspro.com\/documentation\/author\/cvp\/"},"doc_category_info":[{"term_name":"Adjustment","term_url":"https:\/\/contentviewspro.com\/documentation\/cats\/adjustment\/"}],"doc_tag_info":[{"term_name":"custom PHP code","term_url":"https:\/\/contentviewspro.com\/documentation\/tags\/custom-code\/"},{"term_name":"post title","term_url":"https:\/\/contentviewspro.com\/documentation\/tags\/post-title\/"}],"_links":{"self":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/2123","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\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/comments?post=2123"}],"version-history":[{"count":7,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/2123\/revisions"}],"predecessor-version":[{"id":5956,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/2123\/revisions\/5956"}],"wp:attachment":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/media?parent=2123"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_category?post=2123"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_tag?post=2123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}