OK... here's where I am at so far.. I have categories (normal and special) showing and applying on my portfolio items, but I can't seem to get either to actually go as part of the damn URL. I've tried everything I can think of, and everything that anyone else seems to have written about. At this stage, I don't care if it is the taxonomy 'Portfolio Categories' or the standard WP categories that gets appended to this URL, as long as it's one of them.
My portfolio.php file currently looks like this:
-------------------------------------------------------------------
<?php
$pageinfo = array('full_name' => 'Portfolio Options', 'optionname'=>'portfolio', 'child'=>true, 'filename' => basename(__FILE__));
$options = array (
array( "type" => "open"),
array( "name" => "Portfolio Image Link",
"desc" => "When clicking on a Portfolio Image what should happen?",
"id" => "portfolio_click",
"type" => "radio",
"buttons" => array('Big Image opens in Lightbox','Show Portfolio Single Post'),
"std" => 1),
array( "type" => "close"),
array( "type" => "portfolio",
"taxonomy" => "portfolio_entries"
)
);
$options_page = new kriesi_option_pages($options, $pageinfo);
######################################################################
# POST TYPE
######################################################################
add_action('init', 'portfolio_register');
add_action('init', 'portfolio_add_default_boxes');
add_action('init', 'portfolio_taxonomy');
function portfolio_add_default_boxes() {
register_taxonomy_for_object_type('category', 'portfolio');
register_taxonomy_for_object_type('post_tag', 'portfolio');
}
function portfolio_register() {
$labels = array(
'name' => _x('Portfolio Items', 'post type general name'),
'singular_name' => _x('Portfolio Entry', 'post type singular name'),
'add_new' => _x('Add New', 'portfolio'),
'add_new_item' => __('Add New Portfolio Entry'),
'edit_item' => __('Edit Portfolio Entry'),
'new_item' => __('New Portfolio Entry'),
'view_item' => __('View Portfolio Entry'),
'search_items' => __('Search Portfolio Entries'),
'not_found' => __('No Portfolio Entries found'),
'not_found_in_trash' => __('No Portfolio Entries found in Trash'),
'parent_item_colon' => ''
);
$args = array(
'labels' => $labels,
'taxonomies' => array('category', 'post_tag', 'portfolio_entries'),
'public' => true,
'show_ui' => true,
'exclude_from_search' => false,
'capability_type' => 'post',
'hierarchical' => true,
'rewrite' => array(
'slug'=>'media',
'with_back'=>false
),
'query_var' => true,
'show_in_nav_menus'=> false,
'menu_position' => 5,
'supports' => array('title','thumbnail','excerpt','editor','comments','custom-fields','revisions','page-attributes')
);
register_post_type( 'portfolio' , $args );
}
function portfolio_taxonomy() {
register_taxonomy("portfolio_entries",
array("portfolio"),
array( "hierarchical" => true,
"label" => "Portfolio Categories",
"singular_label" => "Portfolio Categories",
"rewrite" => true,
"query_var" => true
));
}
add_action('admin_init', 'flush_rewrite_rules');
#portfolio_columns, <- register_post_type then append _columns
add_filter("manage_edit-portfolio_columns", "prod_edit_columns");
add_action("manage_posts_custom_column", "prod_custom_columns");
function prod_edit_columns($columns){
$newcolumns = array(
"cb" => "<input type=\"checkbox\" />",
"title" => "Title",
"portfolio_entries" => "Categories"
);
$columns= array_merge($newcolumns, $columns);
return $columns;
}
function prod_custom_columns($column){
global $post;
switch ($column)
{
case "description":
#the_excerpt();
break;
case "price":
#$custom = get_post_custom();
#echo $custom["price"][0];
break;
case "portfolio_entries":
echo get_the_term_list($post->ID, 'portfolio_entries', '', ', ','');
break;
}
}
------------------------------------------------------------------------------------------
AAAAAhhhhhhhhhhhhhhhhhhhhhhh!!!!!!!!!!!!!!!!
It's 2:36am.. I've been going around in circles for 4 hours now.. :'-(