Create permalink structure for one taxonomy archive per custom post type

This is very easy to do by adding custom rewrite rules. This should get you started: add_action( ‘init’, ‘wpse_100386_rewrites’ ); function wpse_100386_rewrites() { add_rewrite_rule( ‘case-studies/room/([^/]+)/?’, ‘index.php?the_room=$matches[1]&post_type=the_case_study’, ‘top’ ); add_rewrite_rule( ‘videos/room/([^/]+)/?’, ‘index.php?the_room=$matches[1]&post_type=the_video’, ‘top’ ); } As always when changing rewrite rules, be sure to flush your rewrite rules by going to Settings -> Permalinks and click … Read more

Give attachments an archive page

This is untested, so apologies there, but I’m thinking out loud, have you tried re-registering the post type afterwards? Or flushed rewrite rules after your initial attempt with flush_rewrite_rules();? function change_attachment_post_type() { $args = get_post_type_object(‘attachment’); $args->has_archive = true; $args->rewrite = [ ‘slug’ => ‘media’ ]; register_post_type($args->name, $args); // As a temporary one time, remove after … Read more

Menu Disappears on Category Pages

I know this is an old question but seems that is still unresolved. As @Milo said you may have an incorrect pre_get_posts implementation. Most people do this like this (example): add_filter( ‘pre_get_posts’, ‘query_post_type’ ); function query_post_type( $query ) { if ( is_category() ) { $post_type = get_query_var( ‘post_type’ ); if ( $post_type ) { $post_type … Read more

Archive page with multiple taxonomies rewrite

ok, so I thought I’d come back and answer my own question in case its useful to someone else. To start, the CPT: ‘query_var’ => true, ‘has_archive’ => false, ‘rewrite’ => array( ‘slug’ => ‘resources’, ‘with_front’ => false ), Tax1: ‘query_vars’ => true, ‘rewrite’ => array( ‘slug’ => ‘resources/type’, ‘with_front’ => false ) Tax2: ‘query_vars’ … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)