Custom Content Type Manager
Rewrite Slug - What's It Supposed To Do? (5 posts)

  1. Mike
    Posted 3 years ago #


    I've tried adding a slug using the Rewrite Slug field, and don't see what it's doing. Is it supposed to pre-pend the slug to the CCTM post type?

    Here are my CCTM URL Settings:

    1) Rewrite with Permalink is checked
    2) Permalink Action is set to /%post-name%/
    3) Rewrite Slug is set to "fishing-services" (no quotes)

    And my WP Permalinks Settings:
    1) WP permalinks are set to /%post-name%/
    ( which resorts to http://example.com/sample-post/ )
    2).htaccess is set to handle permalinks


  2. kieranbarnes
    Posted 3 years ago #

    Hi Mike,

    If Archives are enabled, CCTM/WP will use the post type name as the rewrite slug, for exaple /my-post-type (will show the post type archive). The rewrite slug field overwrites this option with a value of your choice.

  3. Mike
    Posted 3 years ago #

    Thanks, kieranbarnes. That's what I would have expected. But the rewrite slug is NOT overwriting the post-type name.

    And, yes, I have enabled Archives in CCTM.

    This works:

    This does not:

    Any suggestions how I might track this down?

    One more piece of information: I have defined a custom taxonomy that uses the same slug. That works, in this sense:

    However, this does not:

    Again, the taxonomy slug is the same as the CCTM slug. Any chance that's causing a problem? (If I disable the taxonomy, I still can't access the CCTM post-type archive using the CCTM slug.)

  4. fireproofsocks
    Plugin Contributor

    Posted 3 years ago #

    For the record, my methodology here has been to create a GUI that allows for all inputs to the register_post_type() function to be passed to that function. That does not always mean I know exactly what those inputs are for, however. I just see that the register_post_type() function requires a string or a boolean etc. and I try to make my forms in the plugin pass that data as transparently as possible.

    I really dislike how WP implements URLs, and I find the rewrite slug to be poorly conceived. I've had bad luck using it myself, if that's of any consolation. I'd look to the official WP docs for discussion as to what the various inputs are for. As of yet, I haven't had to create any sites that required full custom URL support, so the CCTM plugin doesn't offer much explanation on how or why you'd use some of these or even worse, it may be inadvertently sabotaging other WP functionality. If that's the case, please file a bug and I'll add a few test-cases to my unit tests.

    Hope that helps illuminate the issue a bit.

  5. wu-wei
    Posted 3 years ago #

    This functionality is working for me ( WP 3.5. I have a CCT of 'clients' with a rewrite slug of 'design'. Each client is available at /design/client-name/. Changes to the rewrite slug are reflected. As a test I enabled archives in the advanced tab of the CCTM settings page for clients after which an archives page started being generated at /design/.

    I know the rewrite slug for an individual client was working in 3.4.x, not sure if the archive page was.

    If there's anything you'd like to know about my settings, I'm happy to followup.

    I can see the WP_query getting mixed up if you're trying to share the same slug with your taxonomy and CCT. I wonder if you need to flush the rewrite rules after disabling your custom taxonomy?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic