Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a registered post type with 'rewrite' set as slug=>cpt_name, with_front=>true.

register_post_type( 'objection_handling',
                   array(
                                       'rewrite' => array(
                                            'slug' => 'objection_handling',
                                            'with_front' => true
                                            )

I then have a wp_list_pages function with an argument as post_type=>cpt_name. This function successfully displays an unordered list of my custom post type.

I then have custom taxonomies with rewrite=>false.

register_taxonomy(
                  'objection_topics',
                  'objection_handling',
                  array(
                        'hierarchical' => true,
                        'public' => true,
                        'query_var' => true,
                        'rewrite' => false,
                        'labels' => array(
                                          'name' => __( 'Objection Handling Topics' ),
                                          'singular_name' => __( 'Objection Handling Topic' ),
                                          'hierarchical' => true
                                          ),
                        )
                  );

Now I'm thinking this will output a URL like : /objection_handling/[title-of-page] but I'm getting 404 errors.

share|improve this question

2 Answers 2

Ancient question! For the record, ensure that you flush rewrite rules after change post types and taxonomies.

You can do this by visiting Settings > Permalinks in the Dashboard, or programmatically, as the Bones theme does:

// Flush rewrite rules for custom post types
add_action( 'after_switch_theme', 'bones_flush_rewrite_rules' );

// Flush your rewrite rules
function bones_flush_rewrite_rules() {
    flush_rewrite_rules();
}
share|improve this answer

You should change the slug for the taxonomy.

But it seems that you are trying to create a archive? Then you should create a new template file with the taxonomy name instead. But then you are loosing the ability to add a description to the page.

share|improve this answer
    
I rewrote the question. Because I'm using a custom post type, wouldn't I want the URL to be /objection_handling/[objection_topic] ? –  AlxVallejo Jan 14 '12 at 22:36
    
read about the rewrite argument. –  ferenyl Aug 20 '12 at 19:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.