Community Forums › Forums › Archived Forums › Design Tips and Tricks › Taxonomy Template Design
Tagged: taxonomy, template, template hierarchy
- This topic has 6 replies, 3 voices, and was last updated 10 years, 4 months ago by ktrusak.
-
AuthorPosts
-
July 24, 2014 at 11:27 am #115719ktrusakMember
This is a seemingly simple question, that has become overwhelmingly frustrating. I am trying to make a taxonomy template in my child theme, have set up taxonomy.php (also tried with default view, category.php, taxonomy-{term}.php), archive.php) but am not getting anything... all I get are 404s. Have tried the hierarchy up and down. The taxonomies do have the public argument and slugs enabled. The child theme does not have any other broad template files like index or single that would be conflicting, so it is just Genesis framework files outside of my template.
Is there an option that needs to be set somewhere? Or anything else I could be missing really?
Simple code I tried to get any kind of output:
http://pvonstade.wpengine.com/<?php echo 'here'; remove_action( 'genesis_entry_content ', 'genesis_do_entry_content' ); add_action( 'genesis_entry_content', 'wps_grid_loop_helper',99 ); function wps_grid_loop_helper() { global $post; $taxonomy = get_query_var( 'taxonomy' ); echo $taxonomy; echo 'here'; } remove_action('genesis_loop', 'genesis_do_loop'); add_action('genesis_loop', 'my_custom_taxonomy_archive_loop'); function my_custom_taxonomy_archive_loop() { global $post; echo 'here'; } genesis();
July 24, 2014 at 12:20 pm #115727DTHkellyMemberHave you referred to any tutorials? That may show what else is needed.
E.g., http://sridharkatakam.com/adding-portfolio-type-taxonomy-minimum-pro/The 404 error occurs with new Custom Post Types - solved by re-saving permalinks. I have no idea if this will help...
Good luck!
July 24, 2014 at 12:46 pm #115734Brad DaltonParticipantYou add taxonomy support to your custom post type and then create a template
Here' s the code http://wpsites.net/web-design/add-support-for-creating-custom-taxonomies-to-existing-portfolio-custom-post-type/
July 24, 2014 at 3:30 pm #115763ktrusakMemberThanks for the replies, yes, I've tried a few permalink changes and read countless tutorials.
Brad Dalton -- yes, I've set all of those too (I'm using Types for the taxonomies)
At the point I've gotten it to somewhat recognize the template, but the weird thing is that it throws a 404 and is_category() and is_tax() come back false, but is_archive is true... I am getting the term slug in the wp_query var, but no real other information is coming through.. here is a dump if that helps at all http://pastie.org/9418480
The only way I am even getting it to the taxonomy.php file is this (since I noticed the slug was in the query object):
function name_check_404_template( $template = '' ){ global $wp_query; if ( !empty( $wp_query->query_vars['name'] ) ) { $template = locate_template( 'taxonomy.php', false ); } return $template; } add_filter( '404_template', 'name_check_404_template' );
Since even the taxonomy doesn't get returned, I can't even use get_term_by to work backwards. Any ideas welcome.
July 24, 2014 at 3:34 pm #115765Brad DaltonParticipantYou don't need the Types plugin for this. It will only complicate things.
July 24, 2014 at 3:37 pm #115767ktrusakMemberThat's not my concern now at the moment, I have 12+ taxonomies, 8 CPTs, and a few hundred custom fields. Types has worked wonderfully for this same purpose in the past, I'm just trying to troubleshoot this current issue, as even Categories isn't working, so it clearly isn't types.
July 24, 2014 at 3:40 pm #115770ktrusakMemberThank you for taking the time to follow-up though, I appreciate it.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.