so currently i’m using pods to create some individual pages for a log, filled with custom stuff.
now i want to use the comments-system for each of this pages e.g.:
mydomain.com/podpages/page1
mydomain.com/podpages/page2
mydomain.com/podpages/page3
this are not pages created with wordpress so simply adding <?php comments_template(); ?>
is not working.
any ideas how to solve this problem?
thanks in advance
please leave a comment if something is unclear 🙂
When a comment is stored in the WordPress database, the ID of the post (or page) the comment relates to is also stored.
Trouble is, you’re trying to save comments using WordPress, but for a page that it doesn’t actually know about.
So, how about we create a WordPress page for each real page, but merely as a representation, so that your real pages and WordPress have a common ground for working with each other.
So, the plan here is to;
This code should be somewhere at the beginning of the template file used to render your ‘real’ pages;
UPDATE
I can’t believe I was this stupid. Below should replace current code inside outer
if
;P.S I think using the query_var
name
overpagename
is better suited – it queries the slug, rather than the slug ‘path’.You’ll also need to either place an input inside the form with name
redirect_to
and a value of the URL you’d like to redirect to, or, filter the redirect with a function hooked ontocomment_post_redirect
, returning the correct URL.add
to include the wp files. this should give you all the functions/data you need.
Can you create pages in wordpress which display your log data? You might need a new template for this. WordPress will then have something to connect the comments to.
Do you need to use WordPress for this? If not, maybe something in this SO question helps: Unobtrusive, self-hosted comments function to put onto existing web pages
Just supply the wordpress-comment-part with a new ID – start with something your usual posts will never reach (100.000+ is your pages i.e.)
I don’t know exactly if in wordpress it’s a function (saveComment i.e.), but if it is so, just use it in your page with he custom ID.
You will nevertheless have to insert the Comments-form yourself.
And don’t forget to modify the query that gets the news-entires that IDs over 100.000 are not entries.
Or you can write your own template that displays the standard-Worpress-stuff with IDs < 100.000, or else your pages.
Summed up, it should not be very difficult.
p.s.: If you just want to use the wordpress-login, then use any comment-system or make your own (it’s an 1hour-thing) and authenticate / use the worpress-session.