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
nameoverpagenameis 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_toand 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.