{"id":105,"date":"2011-04-08T04:33:38","date_gmt":"2011-04-08T04:33:38","guid":{"rendered":"https:\/\/es.wordpress.org\/support\/topic\/custom-taxonomy-en-custom-post-type\/"},"modified":"2016-08-06T00:09:40","modified_gmt":"2016-08-06T00:09:40","slug":"custom-taxonomy-en-custom-post-type","status":"closed","type":"topic","link":"https:\/\/es.wordpress.org\/support\/topic\/custom-taxonomy-en-custom-post-type\/","title":{"rendered":"Custom Taxonomy en Custom Post Type"},"content":{"rendered":"<p>Hola&#8230;<\/p>\n<p>Estoy creando un sitio en el cual estoy utilizando los Custom Post Type y tambien los Custom Taxonomy para estos.<\/p>\n<p>Mi problema es que he creado un custom post type llamado productos del cual sale su custom taxonomy llamado linea, lo que quiero hacer es que en la pagina de productos salgan todas las categorias creadas para este y que cuando le den click a la categoria X te muestre todos los productos de esa categoria lo cual hasta el momento no he logrado hacer, se supone que para poder hacer eso se utiliza ya sea las paginas de taxonomy-tu_custom_taxonomy.php o nada mas el taxonomy.php o simplemente el archive.php pero siempre que le doy click a una de las categorias me sale no encontrado, no se en realidad que es lo que estoy haciendo mal.<\/p>\n<p>Mi codigo es este del custom post type:<\/p>\n<pre><code>\/Creamos el menu en el CP\nadd_action(&#039;init&#039;, &#039;linea_products&#039;);\n\n\tfunction linea_products() {\n\t\t$linea_args = array(\n\t\t\t&#039;label&#039; =&gt; __(&#039;Productos&#039;),\n\t\t\t&#039;singular_label&#039; =&gt; __(&#039;Productos&#039;),\n\t\t\t&#039;public&#039; =&gt; true,\n\t\t\t&#039;show_ui&#039; =&gt; true,\n\t\t\t&#039;query_var&#039; =&gt; true,\n\t\t\t&#039;rewrite&#039; =&gt; true,\n\t\t\t&#039;capability&#039; =&gt; &#039;post&#039;,\n\t\t\t&#039;hierarchical&#039; =&gt; false,\n\t\t\t&#039;menu_position&#039; =&gt; 30,\n\t\t\t&#039;supports&#039; =&gt; array(&#039;editor&#039;, &#039;title&#039;, &#039;thumbnail&#039;)\n\t\t);\n\n\t\tregister_post_type(&#039;linea&#039;, $linea_args);\n\t}\n\n\tregister_taxonomy(&quot;linea&quot;, array(&#039;linea&#039;), array(&#039;hierarchical&#039; =&gt; true, &#039;label&#039; =&gt; &#039;Categorias de Productos&#039;, &#039;singular_label&#039; =&gt; &#039;Categorias&#039;, &#039;rewrite&#039; =&gt; array( &#039;slug&#039; =&gt; &#039;linea&#039;)));\n\n\tadd_action(&#039;admin_init&#039;, &#039;add_product&#039;);\n\tadd_action(&#039;save_post&#039;, &#039;update_products&#039;);\n\n\tfunction add_product() {\n\t\tadd_meta_box(&#039;product_details&#039;, &#039;Opciones del Producto&#039;, &#039;products_options&#039;, &#039;linea&#039;, &#039;normal&#039;, &#039;low&#039;);\n\t}\n\n\tfunction products_options() {\n\t\tglobal $post;\n\t\t$custom = get_post_custom($post-&gt;ID);\n\t\t$this_new = $custom[&quot;this_new&quot;][0];\n?&gt;\n\t\t&lt;div id=&quot;isnew_product&quot;&gt;\n\t\t\t&lt;label&gt;Es nuevo:&lt;\/label&gt; &lt;?php if($this_new == &#039;on&#039;) { ?&gt; &lt;input type=&quot;checkbox&quot; id=&quot;inp_isnew&quot;  name=&quot;this_new&quot; checked=&quot;checked&quot;&gt;&lt;?php } else { ?&gt;&lt;input type=&quot;checkbox&quot; id=&quot;inp_isnew&quot; name=&quot;this_new&quot;&gt; &lt;?php } ?&gt;\n\t\t&lt;\/div&gt;\n&lt;?php\n\t}\n\n\tfunction update_products() {\n\t\tglobal  $post;\n\t\tupdate_post_meta($post-&gt;ID, &quot;this_new&quot;, $_POST[&quot;this_new&quot;]);\n\t}\n?&gt;<\/code><\/pre>\n<p>Alguien me podria decir como serian las instrucciones para mostrar los resultados en la pagina taxonomy.php por favor, se los agradeceria mucho&#8230;<\/p>\n","protected":false},"template":"","class_list":["post-105","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/105\/revisions"}],"wp:attachment":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}