I have a single post with page breaks, but I only want to show comments and the ability to comment on the last page. Is this possible with WordPress?
1 comment
Comments are closed.
I have a single post with page breaks, but I only want to show comments and the ability to comment on the last page. Is this possible with WordPress?
Comments are closed.
The easiest thing to do is to wrap the code that displays the comments in a conditional like this:
That requires a theme edit, so it is only a good solution if this is a theme you’ve constructed and maintain.
The variables (
global
)$page
and$numpages
are set bysetup_postdata()
and so should be reliable inside any properly constructed Loop.