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'm interested to know if there's a method to specify a specific link structure for only a single category.

Currently I have my install set to /2012/12/post-title. However there is a single category I would like to set to /category-name/post-id/. Part of this is that I don't plan to title any of these posts, but I also would like to make it simple to block this section from being crawled using the robots.txt file.

Possible caveat, I'm using Nginx rather than Apache, so rewrite rules if needed will differ.

Thanks

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

You can use URL rewrites to edit the displayed URL, but without changing your actual wordpress setup all your internal links will still point to the structure assigned in your permalinks settings.

The most straightforward way to do this would be by using a custom post type. With CPTs you can set up a whole different structure for your posts and get as customized or as standard as you want with how wordpress handles it, both internally and externally. You can even make custom taxonomies (post categories is an example of a taxonomy) and associate it only with that CPT.

You can do this manually by editing your functions.php file (good tutorial here) or use a plugin like this one to do the heavy lifting for you.

Here's the codex for registering CPTs

I've recently gotten pretty deep into custom post types, use role creation and management and such. It's really powerful and will save you a lot of hassle with URL rewrites.

share|improve this answer
    
That seems like what I'm looking for (and more). Thanks so much! –  Aka Dec 14 '12 at 5:00
    
One additional question, I can control theming for CPTs using archive-cpt.php / single-cpt.php but is there a way to control the index? Or is it supposed to be covered by archive-cpt.php ? –  Aka Dec 15 '12 at 6:01
    
Yes, custom post types will behave the same way any default post or category page do. So archive-cpt.php and single-cpt.php would be how you manage those two pages. –  Kristina Childs Dec 17 '12 at 18:11
add comment

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.