If page do not display comments
-
If what is being displayed is a page, I do not want the comments section to display. So I put a little if statement in and I am getting variued results.
Please let me know if you have any ideas.
I am trying this:
<?php
if (the_post($static)){
echo '<h2>Feel free to contact us at: [email protected]</h2>';
} else {
echo comments_template(); // Get wp-comments.php template
} ?>It is not working. I also tried this:
<?php
if (isset($page_id)){
echo '<h2>Feel free to contact us at: [email protected]</h2>';
} else {
echo comments_template(); // Get wp-comments.php template
} ?>It also does not work, but that is because of my logic I believe.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘If page do not display comments’ is closed to new replies.