GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Help with a little PHP and the Wordpress Codex (https://gfy.com/showthread.php?t=837055)

Young 06-24-2008 03:44 PM

Help with a little PHP and the Wordpress Codex
 
If I disable comments on a particular post then I'd like it to be reflected on the blog's main with "comments closed" instead of the user clicking on comments and then seeing that they are disabled on the single page.

I'm guessing I need an "If" statement.

If comments are closed then post "comments closed" otherwise "Comments 0, 1"

Who can help me out.

Young 06-24-2008 03:55 PM

Well...figured it out on my own. In case anyone is wondering...

PHP Code:

<?php if ( comments_open() ) : ?>


 <?php else : ?>  <p>Comments Closed</p>

<?php endif; ?>


d-null 06-24-2008 04:39 PM

thank you for sharing :thumbsup


All times are GMT -7. The time now is 05:41 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123