{"id":273,"date":"2015-07-26T09:17:00","date_gmt":"2015-07-26T09:17:00","guid":{"rendered":"http:\/\/docs.contentviewspro.com\/?p=273"},"modified":"2024-02-23T08:27:20","modified_gmt":"2024-02-23T08:27:20","password":"","slug":"create-shortcode","status":"publish","type":"docs","link":"https:\/\/contentviewspro.com\/documentation\/article\/create-shortcode\/","title":{"rendered":"How to create View shortcode?"},"content":{"rendered":"<p>You can create unlimited View shortcodes to display your posts, pages, custom post types in beautiful grid\/list layouts.<\/p>\n<p>To start, in the left menu of your Admin dashboard, click on <strong>Content Views &gt;&gt; Add View<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-5020\" style=\"width: 150px;\" src=\"https:\/\/contentviewspro.com\/documentation\/wp-content\/uploads\/2023\/11\/add-new-view.png\" alt=\"\" width=\"180\" height=\"193\" \/><\/p>\n<p>In the View page, please follow 3 simple steps below:<\/p>\n<p><strong>&#8211; Step 1<\/strong> : in <strong>Filter Settings<\/strong> tab, filter your desired content (post, page, product, etc.) by ID, category, tag, author, keyword, and so on.<\/p>\n<p><strong>&#8211; Step 2<\/strong> : in <strong>Display Settings<\/strong> tab, select one from many beautiful layouts to display your content. You can customize the layout with many useful settings.<\/p>\n<p><strong>&#8211; Step 3<\/strong> : Save the View, then paste the generated shortcode <code>[pt_view id=\"UNIQUE_ID\"]<\/code> to anywhere you want to display your grid\/list (Classic editor, Gutenberg editor, Text widget, Page builder &#8212; <a href=\"https:\/\/contentviewspro.com\/documentation\/article\/insert-view-shortcode-to-editor-and-theme\/\" target=\"_blank\" rel=\"noopener\">click here to read more details<\/a>).<\/p>\n<p>You also can add this code <code>&lt;?php echo do_shortcode('[pt_view id=\"UNIQUE_ID\"]'); ?&gt;<\/code> to theme files.<\/p>\n<h2>Notices:<\/h2>\n<ul>\n<li>Please <strong><ins>DO NOT<\/ins><\/strong> wrap the View shortcode inside <code>&lt;pre&gt;&lt;\/pre&gt;<\/code> tag like this<br \/>\n<code>&lt;pre&gt;[pt_view id=\"UNIQUE_ID\"]&lt;\/pre&gt;<\/code>.<\/li>\n<\/ul>\n<h2>This is the video demonstrates 3 above steps:<\/h2>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/QgQLjB0DQ8s?rel=0&amp;showinfo=0&amp;vq=hd720&amp;hd=1&quot;\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>Thank you,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can create unlimited View shortcodes to display your posts, pages, custom post types in beautiful grid\/list layouts. To start, in the left menu of your Admin dashboard, click on Content Views &gt;&gt; Add View. In the View page, please follow 3 simple steps below: &#8211; Step 1 : in Filter Settings tab, filter your &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/contentviewspro.com\/documentation\/article\/create-shortcode\/\"> <span class=\"screen-reader-text\">How to create View shortcode?<\/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":[7],"doc_tag":[],"class_list":["post-273","docs","type-docs","status-publish","hentry","doc_category-view-shortcode"],"year_month":"2026-05","word_count":193,"total_views":"0","reactions":{"happy":"0","normal":"2","sad":"2"},"author_info":{"name":"admin1","author_nicename":"admin1","author_url":"https:\/\/contentviewspro.com\/documentation\/author\/admin1\/"},"doc_category_info":[{"term_name":"View (Shortcode)","term_url":"https:\/\/contentviewspro.com\/documentation\/cats\/view-shortcode\/"}],"doc_tag_info":[],"_links":{"self":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/273","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=273"}],"version-history":[{"count":11,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/273\/revisions"}],"predecessor-version":[{"id":5804,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/273\/revisions\/5804"}],"wp:attachment":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/media?parent=273"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_category?post=273"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_tag?post=273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}