{"id":2704,"date":"2018-01-02T05:20:22","date_gmt":"2018-01-02T05:20:22","guid":{"rendered":"https:\/\/docs.contentviewspro.com\/?p=2704"},"modified":"2023-12-27T11:09:14","modified_gmt":"2023-12-27T11:09:14","password":"","slug":"show-structured-data-wordpress-posts-list-view","status":"publish","type":"docs","link":"https:\/\/contentviewspro.com\/documentation\/article\/show-structured-data-wordpress-posts-list-view\/","title":{"rendered":"Show the structured data (schema markup) of the WordPress posts list"},"content":{"rendered":"<p>Structured data is a standardized format for providing information about a page and classifying the page content; for example, on a recipe page, what are the ingredients, the cooking time and temperature, the calories, and so on.<br \/>\nYou can <a href=\"https:\/\/developers.google.com\/search\/docs\/guides\/intro-structured-data\" rel=\"noopener noreferrer\" target=\"_blank\">read more about it here<\/a>.<\/p>\n<p>This document includes solution to display structured data of the WordPress posts list by Content Views (and Content Views Pro) in JSON-LD format.<br \/>\nThis data has a short description of each item in the list, and each description points to a separate details page that is focused entirely on one item, for example:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/contentviewspro.com\/documentation\/wp-content\/uploads\/2018\/01\/structured-data.png\" alt=\"structured-data\" width=\"410\" height=\"432\" class=\"alignnone size-full wp-image-2707\" srcset=\"https:\/\/contentviewspro.com\/documentation\/wp-content\/uploads\/2018\/01\/structured-data.png 410w, https:\/\/contentviewspro.com\/documentation\/wp-content\/uploads\/2018\/01\/structured-data-285x300.png 285w\" sizes=\"auto, (max-width: 410px) 100vw, 410px\" \/><\/p>\n<p>To generate that summary structured data, please add this code to file <strong>functions.php<\/strong> in the theme&#8217;s folder:<\/p>\n<pre style=\"font-size:13px\">\n\/\/ Content Views - show structured data of the posts list\nadd_action( 'wp_footer', 'cvp_theme_show_structured_data' );\nfunction cvp_theme_show_structured_data() {\n\tif ( !empty( $GLOBALS[ 'cv_posts' ] ) ) {\n\t\t$list = array();\n\t\tforeach ( $GLOBALS[ 'cv_posts' ] as $idx =&gt; $post ) {\n\t\t\t$list[] = array(\n\t\t\t\t&quot;@type&quot;\t\t =&gt; &quot;ListItem&quot;,\n\t\t\t\t&quot;position&quot;\t =&gt; $idx + 1,\n\t\t\t\t&quot;url&quot;\t\t =&gt; get_permalink( $post )\n\t\t\t);\n\t\t}\n\n\t\techo '&lt;script type=&quot;application\/ld+json&quot;&gt;{&quot;@context&quot;:&quot;http:\/\/schema.org&quot;, &quot;@type&quot;:&quot;ItemList&quot;, &quot;itemListElement&quot;:' . json_encode( $list, JSON_UNESCAPED_SLASHES ) . '}&lt;\/script&gt;';\n\t}\n}\n<\/pre>\n<p>Best regards,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Structured data is a standardized format for providing information about a page and classifying the page content; for example, on a recipe page, what are the ingredients, the cooking time and temperature, the calories, and so on. You can read more about it here. This document includes solution to display structured data of the WordPress &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/contentviewspro.com\/documentation\/article\/show-structured-data-wordpress-posts-list-view\/\"> <span class=\"screen-reader-text\">Show the structured data (schema markup) of the WordPress posts list<\/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":[55],"doc_tag":[21],"class_list":["post-2704","docs","type-docs","status-publish","hentry","doc_category-advanced-modification","doc_tag-custom-code"],"year_month":"2026-09","word_count":218,"total_views":"4","reactions":{"happy":"0","normal":"2","sad":"0"},"author_info":{"name":"CVP","author_nicename":"cvp","author_url":"https:\/\/contentviewspro.com\/documentation\/author\/cvp\/"},"doc_category_info":[{"term_name":"Advanced Modification","term_url":"https:\/\/contentviewspro.com\/documentation\/cats\/advanced-modification\/"}],"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\/2704","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=2704"}],"version-history":[{"count":1,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/2704\/revisions"}],"predecessor-version":[{"id":5451,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/2704\/revisions\/5451"}],"wp:attachment":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/media?parent=2704"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_category?post=2704"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_tag?post=2704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}