Help with a little PHP and the Wordpress Codex

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Young
    Bland for life
    • Nov 2004
    • 10468

    #1

    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
    Bland for life
    • Nov 2004
    • 10468

    #2
    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; ?>
    ★★★

    Comment

    • d-null
      . . .
      • Apr 2007
      • 13724

      #3
      thank you for sharing

      __________________

      Looking for a custom TUBE SCRIPT that supports massive traffic, load balancing, billing support, and h264 encoding? Hit up Konrad!
      Looking for designs for your websites or custom tubesite design? Hit up Zuzana Designs
      Check out the #1 WordPress SEO Plugin: CyberSEO Suite

      Comment

      Working...