Viewing 10 replies - 1 through 10 (of 10 total)
  • I have the same question . Anyone can give a answer or a link with details about how to do that ?

    Thanks.

    Note the ‘rewrite’ => array(‘slug’=>”) in code below.

    register_post_type('listing', array(
    			'labels' => $labels,
    			'singular_label' => __('Listing'),
    			'public' => true,
    			'show_ui' => true,
    			'_builtin' => false,
    			'_edit_link' => 'post.php?post=%d',
    			'capability_type' => 'post',
    			'hierarchical' => true,
    			'rewrite' => array('slug'=>''),
    			'query_var' => $base_slug,
    			'taxonomies' => array('skill','industry'),
    			'supports' => array('title','editor', 'thumbnail')
    		));
    Thread Starter nimaha

    (@nimaha)

    Thanks for the response. I had previously tried your suggestion but get a 404 error.

    Even when I write the slug as blank, I can still get to the post by inserting the name of the custom post type in the URL where the slug goes.

    None of this seems right. From reading around, it feels like this should be pretty simple.

    Is ‘California’ a post type or a taxonomy term?

    Thread Starter nimaha

    (@nimaha)

    Region is the post type. California would be a post within that type.

    Did you ever figure this out? I just wrote a rather complex plugin that uses a lot of custom post types, and ended up having the plugin create all of its custom rewrite rules, I can send you some information if you’d like. Shoot me a message though twincitiestech.com

    Same issue here. Has anyone resolved this yet?

    Same problem here.

    I try to use add_new_rules() to add a new rewrite rule, but not works.

    volcomjon

    (@volcomjon)

    Hi there.

    once again, im also having this same problem – I have a custom post type of “products” therefore giving me the url of https://www.blogname.com/products/productname

    I also have a custom page template : page-products.php which within will load the loop of “products” (which are the new post types)

    my IDEAL situation would be to have the following, however my knowledge of php and url rewrites is a little on the “shy” side shall we say, and therefore desperately need your help.

    option 1:
    to explictly set the full url against each post type, maybe using a custom field?

    option 2:
    using an already existing custom field to adjust the url accordingly, for example the final url I would like to see is:

    https://www.blogname.com/brandname/productname

    brandname = custom field
    productname = title of custom post type (this isnt where the problem is)

    it doesnt really matter how this is performed or by which method – it just needs to be done ??

    I REALLY NEED SOME GUIDANCE OR HELP ON THIS. ANY ADVICE OR TIPS VERY WELCOME

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Custom Post Type Rewrite Permalink and Exclude base’ is closed to new replies.