Support » Themes and Templates » Can't get a custom template taxonomy page to display

  • Hi All,

    I’ve been trying to wade my way through learning the ins and outs of taxonomies and how to integrate them into themes and I’ve run into a pretty basic issue that I can’t seem to figure out.

    I started working on this in a Buddypress install using More Taxonomies. After not being able to get the custom template to load (taxonomy-platform.php) using the rewrite slug of platform… http://www.mydomain.com/wpinstall/platform …. I deleted the taxonomies from More Taxonomies (but not the entries in the database for terms), uninstalled More Taxonomies and entered the Taxonomies into my buddypress functions.php.

    First I used

    //hook into the init action and call create_platform_taxonomies when it fires
        add_action( 'init', 'create_platform_taxonomies', 0);
        //create the non-heirarchical Platforms taxonomy
        function create_platform_taxonomies()
        {
    
          // Adding a taxonomy for Platforms, non heirarchical
        $labels = array(
            'name' => _x( 'Platforms', 'taxonomy general name' ),
            'singular_name' => _x( 'Platform', 'taxonomy singular name' ),
            'search_items' =>  __( 'Search Platforms' ),
            'popular_items' => __( 'Popular Platforms' ),
            'all_items' => __( 'All Platforms' ),
            'parent_item' => null,
            'parent_item_colon' => null,
            'edit_item' => __( 'Edit Platform' ),
            'update_item' => __( 'Update Platform' ),
            'add_new_item' => __( 'Add New Platform' ),
            'new_item_name' => __( 'New Platform Name' ),
            'separate_items_with_commas' => __( 'Separate platforms with commas' ),
            'add_or_remove_items' => __( 'Add or remove platforms' ),
            'choose_from_most_used' => __( 'Choose from the most used platforms' ),
            'menu_name' => __( 'Platforms' ),
          ); 
    
          register_taxonomy('platform',
        	array( 'post', 'page', 'mediapage', 'attachment', 'revision', 'nav_menu_item', 'cheats', 'reviews', 'tutorials' ),
        		array(
        			'hierarchical' => false,
        			'labels' => $labels,
        			'show_ui' => true,
        			'query_var' => true,
        			'rewrite' => array( 'slug' => 'platform' ),
          ));
        }

    but that still didn’t allow it to work properly.

    *Let me note here that I have been over-zealous about flushing my rewrites using the Permalinks page save method during this entire process.

    I then rolled back to 2010, and entered that same code into functions.php, and tried again, same result. The taxonomy showed up under all the post types, it pulled the old term data from the database, entered into posts correctly, but I could not bring up the taxonomy-platform.php page, always getting a “that page could not be found” error.

    so now I wrote what I felt was a much more dumbed down taxonomy and tried that;

    add_action( 'init', 'create_testtax_taxonomies', 0);
    
         function create_testtax_taxonomies()
         {
         register_taxonomy ( 'testtax', array( 'post', ),
        	array(
        		'hierarchical' => false,
        		'labels' => array( 'Testtax', ),
        		'show_ui' => true,
        		'query_var' => true,
        		'rewrite' => array( 'slug' => 'testtax' ),
        		));
    
         }

    this showed up (although its titled as a second ‘Post Tags’ in my Posts post type but I figured that’s cause I cut down on labeling so heavily), but displayed the same behavior when trying to navigate to http://www.mydomain.com/wpinstall/testtax

    this is my code for the taxonomy-testtax.php page

    <?php
    
        /* This is the custom template for
        * the platforms taxonomy.
        */
    
        get_header(); ?>
    
        		<div id="container">
        			<div id="content" role="main">
        hello
    
        			</div><!-- #content -->
        		</div><!-- #container -->
    
        <?php get_sidebar(); ?>
        <?php get_footer(); ?>

    Again, for the moment as simple as possible, but I’ve also used copies of the index and other various loop-enabled pages.

    Any help would be appreciated, thanks in advance! Not sure if I’m missing something simple, or skipping a process in properly enabling taxonomies… just not sure.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Can't get a custom template taxonomy page to display’ is closed to new replies.