logo

$8
Wordpress taxomony 404

Hey Guys,

If you have a look here:

Working

the link works fine but I don't want the ?querystring format, I would rather

http://www.eirestudio.net/themeforest/psd-planet-wp/tutorials/hi

but this produces a 404.

Not working

------------------

Here is my code in functions.php:

//==============================================================================
// Create New Post Types

add_action('init', 'create_tutorials_post_type');

function create_tutorials_post_type()
{
register_post_type
(
'tutorials', array
(
'labels' => array
(
'name' => 'Tutorials',
'singular_name' => 'Tutorial',
'add_new' => 'Add New Tutorial',
'add_new_item' => 'Add New Tutorial',
'edit' => 'Edit Tutorials',
'edit_item' => 'Edit Tutorial',
'new_item' => 'New Tutorial',
'view' => 'View Tutorial',
'view_item' => 'View Tutorial',
'search_items' => 'Search Tutorials',
'not_found' => 'No tutorials found',
'not_found_in_trash' => 'No tutorials found in Trash',
'parent' => 'Parent Tutorial'
),
'supports' => array
(
'title',
'editor',
'excerpt',
'trackbacks',
'custom-fields',
'comments',
'revisions',
'thumbnail',
'author',
'page-attributes'
),
'public' => true,
'rewrite' => false,
'query_var' => true,
'menu_position' => 4
)
);
}




//==============================================================================
// Create Taximonies
add_action( 'init', 'create_tutorial_taxonomies' );

function create_tutorial_taxonomies()
{
register_taxonomy
(
'tutorials_categories',
'tutorials',
array
(
'labels' => array
(
'name' => 'Tutorial Categories',
'singular_name' => 'Tutorial Category',
'search_items' => 'Search Tutorial Category',
'popular_items' => 'Popular Tutorial Category',
'all_items' => 'All Tutorial Category',
'parent_item' => 'Parent Tutorial Category',
'parent_item_colon' => 'Parent Tutorial Category:',
'edit_item' => 'Edit Tutorial Category',
'update_item' => 'Update Tutorial Category',
'add_new_item' => 'Add New Tutorial',
'new_item_name' => 'New Tutorial Name'
),
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'query_var' => '',
'show_tagcloud' => true,
)
);
}

Keith Donegan | 06/29/10 at 12:38pm | Edit


(3) Possible Answers Submitted...

  • avatar
    Last edited:
    06/29/10
    12:43pm
    Jarret Minkler says:

    isn't there a better way to do this? :)

    Previous versions of this answer: 06/29/10 at 12:43pm

    • 06/29/10 12:43pm

      Keith Donegan says:

      Hay, 404 is the Not working link: http://www.eirestudio.net/themeforest/psd-planet-wp/tutorials/hi/

      have a look at the title

    • 06/29/10 12:45pm

      Jarret Minkler says:

      Yeah, saw that.

  • avatar
    Last edited:
    06/29/10
    3:27pm
    Darrin Boutote says:

    It appears you need to change your permalink settings in the Dashboard. It's under the Settings menus in the Dashboard (settings->permalinks). You can choose any one of the common settings listed or create a custom one. I'd recommend either the "Day and Name" or "Month and Name" settings.

    Just choose your setting, and then click "Save Changes". WordPress will attempt to create an .htaccess file with rewrite rules. If it can, you should be all set, if not you'll be shown a message with instructions on what to do next.

    Previous versions of this answer: 06/29/10 at 12:45pm

    • 06/29/10 12:46pm

      Keith Donegan says:

      Thanks for the reply, I did already try that and my structure is just /%postname%/

      :(

    • 06/29/10 1:03pm

      Darrin Boutote says:

      See this line: 'rewrite' => false,

      change it to 'rewrite' => true,

      Then re-save your permalinks settings.

  • avatar
    Last edited:
    06/29/10
    1:30pm
    Milan Petrovic says:

    Much simpler than to add code directly is to use my GD Custom Posts and Taxonomies Tools plugin that has full interface for this and flushes permalinks rules when needed and will let you experiment with different settings very quickly:

    http://dv4p.com/gdtt

    Previous versions of this answer: 06/29/10 at 1:30pm | 06/29/10 at 1:30pm

This question has expired.





Current status of this question: Completed