{"id":13308616,"date":"2020-08-25T06:31:40","date_gmt":"2020-08-25T06:31:40","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/archive-page-missing\/"},"modified":"2020-08-25T06:49:20","modified_gmt":"2020-08-25T06:49:20","slug":"archive-page-missing","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/archive-page-missing\/","title":{"rendered":"Archive page missing"},"content":{"rendered":"<p>hello, <\/p>\n<p>First of all: many thanks to all users that help others in this kind of forums!!<\/p>\n<p>I am writing because when I access to YOAST &gt; Search Appearance &gt; Archive, it only displays Author and Date archives and the 404 page in the special pages section.<\/p>\n<p>However, my theme has a custom type (Projects). I have checked the code and it is defined in the following way:<\/p>\n<pre><code>\/\/ CPT projects\nfunction lo_cont_projects() {\n  $labels = array(\n    &#039;name&#039;               =&gt; __( &#039;Projects&#039;, &#039;offcours&#039; ),\n    &#039;singular_name&#039;      =&gt; __( &#039;Project&#039;, &#039;offcours&#039; ),\n    &#039;add_new&#039;            =&gt; __( &#039;Add new project&#039;, &#039;offcours&#039; ),\n    &#039;add_new_item&#039;       =&gt; __( &#039;Add new project&#039;, &#039;offcours&#039; ),\n    &#039;edit_item&#039;          =&gt; __( &#039;Edit project&#039;, &#039;offcours&#039; ),\n    &#039;new_item&#039;           =&gt; __( &#039;New project&#039;, &#039;offcours&#039; ),\n    &#039;all_items&#039;          =&gt; __( &#039;All projects&#039;, &#039;offcours&#039; ),\n    &#039;view_item&#039;          =&gt; __( &#039;View project&#039;, &#039;offcours&#039; ),\n    &#039;search_items&#039;       =&gt; __( &#039;Search project&#039;, &#039;offcours&#039; ),\n    &#039;not_found&#039;          =&gt; __( &#039;No found project&#039;, &#039;offcours&#039; ),\n    &#039;not_found_in_trash&#039; =&gt; __( &#039;No found project in trash&#039;, &#039;offcours&#039; ),\n    &#039;menu_name&#039;          =&gt; __( &#039;Projects&#039;, &#039;offcours&#039; )\n  );\n  $args = array(\n    &#039;labels&#039;        =&gt; $labels,\n    &#039;description&#039;   =&gt; &#039;Projects items&#039;,\n    &#039;public&#039;        =&gt; true,\n    &#039;show_ui&#039;       =&gt; true,\n    &#039;menu_position&#039; =&gt; 4,\n    &#039;menu_icon&#039;     =&gt; &#039;dashicons-portfolio&#039;,\n    &#039;supports&#039;      =&gt; array(&#039;title&#039;,&#039;thumbnail&#039;,&#039;editor&#039;),\n    &#039;has_archive&#039;   =&gt; true,\n    &#039;rewrite&#039;       =&gt; array(&#039;slug&#039; =&gt; __(&#039;projects&#039;, &#039;offcours&#039; ))  \n  );\n  register_post_type( &#039;projects&#039;, $args );\n}\nadd_action( &#039;init&#039;, &#039;lo_cont_projects&#039; );<\/code><\/pre>\n<p>The Custom type is defined as has_archive=true. According to the documentation of Yoast, whith this definition it should be displayed in the page. <\/p>\n<p>There is no page in wordpress for this archive, but in the file &#8220;arvhice.php&#8221; there is the following code:<\/p>\n<pre><code>\/* Start the Loop *\/\nwhile ( have_posts() ) : the_post();\n\n    if( is_post_type_archive(&#039;projects&#039;) || is_tax(&#039;projectstypes&#039;) ):\n\n        get_template_part( &#039;template-parts\/content&#039;, &#039;projects&#039; );\n\n    else:\n        get_template_part( &#039;template-parts\/content&#039;, &#039;posts&#039; );\n\n    endif;\n\nendwhile;<\/code><\/pre>\n<p>So, when the page \/projects is called, it automatically shows the projects archive page ad the contents as they are defined in the template part. <\/p>\n<p>Could anybody help me to find why Yoast SEO is not displaying this custom type then?<\/p>\n<p>Thank you in advanced!!<\/p>\n","protected":false},"template":"","class_list":["post-13308616","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/13308616","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":3,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/13308616\/revisions"}],"predecessor-version":[{"id":13308631,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/13308616\/revisions\/13308631"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=13308616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}