The error is in the syntax; there’s a semicolon after the if condition. Try this:
<?php
$page_comment = get_query_var('cpage');
if ($page_comment > 0): ?>
test
<?php endif; ?>
Alternative PHP syntax:
<?php
$page_comment = get_query_var('cpage');
if ($page_comment > 0){ ?>
test
<?php } ?>
Related Posts:
- Paginate result set from $wpdb->get_results()
- Reverse comment pagination numbers
- Is there any way to override “break comments into pages” and “close comments for old posts” on certain posts, but not on others?
- How to no follow the paginated comments
- Comments Pagination as an unordered list
- How to add pagination to comments?
- Comment pagination – How to show determined number of comments on the first page?
- changing comment-page-# to something like review-page-#
- How do you turn on comments for only the last page of a paginated post?
- Redirect to page 2 after comment
- Set noindex page-comment from Pages 2, 3 and More?
- Pagination Comments Doesn’t Show
- PAIN. Comments Pagination
- assumed as comment line
- Comment Pagination
- get_query_var(‘paged’) for WP_Comment_Query always return 1 when using paginate_comments_links()
- Comments pagination: reverse JUST the links texts (1-2-3 to 3-2-1), not comments order
- Comments pagination on author page
- Comment submission & navigation redirects to default language
- If paginated comments don’t span to a second page, how do I hide the div wrapper?
- WordPress comment pagination : newest comments on first page
- Pagination comments
- Remove “#comments” from comments pagination url
- Change Comment Author Display Name
- comments reply script not working
- Threaded comments – deleting parent comment leads to orphan comments
- How to remove commenters ability to add hyperlinks to comments?
- How can I edit the email sent when a new comment is received?
- How to remove or replace the log-in link for comment replies?
- Exclude internal links from comment moderation?
- Add Comment Custom Field
- Remove link preview in discussion dashboard
- Can’t add default comments to custom post type
- Does Akismet plugin expose any hooks, functions, class that can work with custom code?
- Comments Feed & Custom Post Statuses
- Multiple Comment Forms in a single page [closed]
- Why Allow Script Commands in Comments?
- Displaying comments with a walker: how to distinguish between parent and child comments
- Count parent comments & replies separately?
- How to modify comments form using comment_form()?
- Capability for allowing user to post own comments without moderation
- Comment count wrong with orphaned comments
- How would I count the number of times a comment meta field’s value is in a post’s entire comments?
- Get comment content by comment ID
- stackexchange-like submit comment window
- Retrieve comments from current post using SQL
- Comment_Reply_Link Not Showing?
- Display recent comments with gravatar and excerpts?
- Limit user to one comment
- Is comment metadata included in the export file?
- Get a List of All Commenters on the Current Post
- Display the number of unseen comments on a page since the user last visit
- Log in link not showing, Comment Issue
- Removing the limit on the number of nested comments
- How to call my custom WordPress Comment form without getting the comments?
- How to moderate (manually approve) comments of a specific (registered) User
- How would I add the comment count to this sub-pages of current page snippet
- How can I test why the comment hook is not working?
- How to limit comment author to one comment per post
- How do i remove “Website” field from WordPress comments
- WordPress comments work locally only?
- comment reply by email
- Incorrect redirection after commenting on custom type
- “Discussion” checkboxes unchecked by default on pages? [duplicate]
- How to disable or hide WordPress.com as a social media login option for Jetpack Comments [closed]
- How to limit comment indentations to one level?
- Minimum allowed comment length only on a specific page
- How can get comment id from comment link?
- How to Add text to the start of all comment?
- How can I count only guests comments?
- Pending Comments
- Anonymous spam comments when only registered users can comment
- Limit iframe output in comment-meta commentmetadata
- Crossposting from WP to Blogger with comments
- REST API : Get post title with comment
- reply comment below the comment box without reload page
- Comment area visible but comments not being saved
- Write html code in comments
- How to post one comment for all the translated posts
- How do i add comment fields in my page in WordPress
- twenty seventeen theme: comments UI not visible
- where can I find the missing comments in my wordpress dashboard?
- How do I alter the comments form in several different ways?
- Comment moderation
- I have tried using Plugins to remove 72K comments with no success
- How to check if post has previous_comments_link() and next_comments_link()
- Comment text area in single blog post and show comments if approved
- Comments – Ensure the correct field is highlighted for nested replies
- How to ‘If Author’ Comments Check
- selectively disable akismet
- Disqus moderation page not working in WordPress admin section
- Comment Blacklist
- Comment forum to display under the comment you’re replying too
- WordPress Page Template: Comment Filtering with Querystring
- Modify “Recent Comments” List in WP-Admin
- comments are going to spam
- How to hide the login / profile urls on top of comment box for a post
- wp_list_comments adds unnecessary elements
- How to enable truly anonymous posting in bbPress forums? [closed]
- Add ACF Quick Edit Columns on Comments