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 want to edit my permalink structure so that individual post URLs are structured like this...blog.com/p1, blog.com/p2, blog.com/p523, etc

I also want to edit my permalink structure so that comment URLs are structured like this this...blog.com/c1, blog.com/c2, blog.com/c324, etc

Are these two things possible via the permalink settings? If not could it be possible via building a customized plugin?

Also...I'd like each comment to live on a dedicated page. Comments would still appear below posts, but each comment would have its own permalink that went to a dedicate page containing just that comment. Would something like this be possible via building a customized plugin?

Thanks in advance for any advice you can offer!

Eddie

share|improve this question

2 Answers 2

You can change the permalink setting to /p%post_id%, but this will also set the front property of the WP_Rewrite object to /p, so some URLs will also get this in front (/pauthor for example). You can counter this by changing the $wp_rewrite->front property again:

add_action( 'permalink_structure_changed', 'wpse5595_rewrite_front_reset' );
add_action( 'init', 'wpse5595_rewrite_front_reset' );
function wpse5595_rewrite_front_reset()
{
    $GLOBALS['wp_rewrite']->front = '/';
}

You must do this on every init so the generated links are OK, and on every permalink_structure_changed so the generated rules (that handle incoming URLs) are OK.

Comments on separate pages should be possible. I suggest you first try to find a plugin that does this, then we can figure out how to change the URL structure it uses.

share|improve this answer

Separate pages for individual comments seems like what SEO Super Comments plugin does.

share|improve this answer
    
This plugin seems to generate dynamic pages for the comments that aren't store in the database, whereas I'm looking to generate static pages for each comment that are stored in the database. –  Eddie Dec 18 '10 at 18:38
    
@Eddie: I think you are talking about the same thing. The plugin "dynamically" creates a page for each comment, without you needing to create it as a new WordPress Page. So they are not stored as pages in the database (but of course still exist as comments in the database). –  Jan Fabry Dec 20 '10 at 12:31
    
I have tried the plugin myself (on 3.1 beta 1), but I don't recommend it. It creates the extra page by faking a post object with the contents of the comment you want to display. The code style is sloppy, and it needs some modifications to run without errors on the current version of WordPress. –  Jan Fabry Dec 23 '10 at 9:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.