0

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

2 Answers 2

1

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.

0

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

3
  • 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
    Commented Dec 18, 2010 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
    Commented Dec 20, 2010 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
    Commented Dec 23, 2010 at 9:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.