Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter noblestreet

    (@noblestreet)

    Ok in the meantime i have done some diggin around my self. I ended up going thru the class-wp.php file (WP::parse_request). I came up with the following rewrite rule which works with my CPT.

    function add_cpt_rules() {
      global $wp_rewrite;
      add_rewrite_rule(
        "showcase/([^/]+)(/[0-9]+)?/?$",
        "index.php?showcase=" . $wp_rewrite->preg_index(1) . "&page=" . $wp_rewrite->preg_index(2),
        "top");
    
      add_rewrite_rule(
        "work/([^/]+)(/[0-9]+)?/?$",
        "index.php?work=" . $wp_rewrite->preg_index(1) . "&page=" . $wp_rewrite->preg_index(2),
        "top");
    
      $wp_rewrite->flush_rules();
    }
    add_action( 'init', 'add_cpt_rules' );

    showcase and work are my additional CPTs i removed the extra template include function. As WP now grabs the post_type for the relevant template file.

    Using Debug This plugin helped a lot. (http://websynthesis.com/fixing-wordpress-404-errors/)

    regards,

    Arnaud

Viewing 1 replies (of 1 total)