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.

Wordpress - comments_template().

I am currently trying to work with an outdated wordpress addon and I wish to add the functionality to allow commenting on certain pages.

However each page url looks like:

/match/?match=1
/match/?match=2
/match/?match=3

So when I post comments on a page they are displayed okay, however when a comment is made it appears in the 3 pages listed above rather just the one page the comment was made on.

So my question is how do I make it so comments_template() sees match=1,2,3, etc as individual pages rather than the same page with just different get statements.

edit

The URL structure is:

http://pantheones.com.au/pes-csgo-open-league/match-table/?match=1
http://pantheones.com.au/pes-csgo-open-league/match-table/?match=2
http://pantheones.com.au/pes-csgo-open-league/match-table/?match=3

Each URL displays different information depending on the number of match and I want separate comments on each match.

share|improve this question
    
Please provide some details what that URL structure means and how is it implemented. –  Rarst Mar 17 '12 at 20:42
    
Updated a little bit, is that what you wanted to know? –  Rambomst Mar 17 '12 at 21:02

1 Answer 1

As far as WordPress is concerned, the individual match pages are the same page, the presence of your GET var is meaningless to WordPress.

option 1 - make the individual matches unique objects, such as additional pages or a custom post type.

option 2 - hook comment_post and update_comment_meta when a comment is submitted to store the associated match id the comment was entered on as meta data. you'd then filter comment output in your wp_list_comments callback to only display comments with meta value that matches the current match.

share|improve this answer

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.