WordPress.org

Support

Support » Plugins and Hacks » Custom Comment Permalink

Custom Comment Permalink

  • I’ve separated my comments from the posting page (similar to the way A List Apart arranges their comments on articles), but when I using anything other than the default permalink structure, the comments are not found. How can I write a custom RewriteRule for my comments?

    Using this post, to separate my comments from the post itself, and this post, in an attempt to make use of the new way WP writes the permalinks, I added the following to my functions.php file:

    function comment_perma($rules)
    {
    $rules['^/([0-9]{4})/([0-9]{1,2})/([^/]+)?/comments/?$'] = '/?year=$1&monthnum=$2&name=$3&comments=1';
    return $rules;
    }
    add_filter('rewrite_rules_array', 'comment_perma');

    That didn’t work. When I use anything other than the default permalink structure, I can’t get to the comments.

    Anyone have any suggestions for me? Here’s a link to my site (note that I’ve reverted back to the default permalink structure)
    w w w. toddseal.com/teaching

  • The topic ‘Custom Comment Permalink’ is closed to new replies.
Skip to toolbar