WordPress.org

Ready to get started?Download WordPress

Forums

Liquorice
[resolved] Comment.php Modified, Sidebar Disappeared (6 posts)

  1. Angela
    Member
    Posted 2 years ago #

    I'm trying to modify a wordpress theme so that if I disable commenting on the page/post, nothing show up (I want to make the 'comment is currently closed' tag to go away). This is the original php file http://pastebin.com/RBQqW9mn .

    I made some modification (tuck the H2 element into the if block, so if it's not true, then the message won't show), and this is the current php file http://pastebin.com/sr88Dk9z . After I saved the file, the sidebar just disappeared, why? I don't see a single line of code that relates to the sidebar.

    Angela

    PS: in addition, where is the code for the current widget. This theme has only one widget, but I don't see any register widget function in functions.php (I probably need to replicate it to create a second widget)

    Edit: I should be a little more precise, the sidebar just disappeared on the page where comment was disabled. However, on the page where comment is enabled, the sidebar shows.

    http://wordpress.org/extend/themes/liquorice/

  2. sacredpath
    Moderator
    Posted 2 years ago #

    Why not just identify the selector for the "comments is currently closed" text in the CSS and do a display: none; ?

  3. sacredpath
    Moderator
    Posted 2 years ago #

    It looks like this would do it.

    .nocomments {
    display: none;
    }
  4. Angela
    Member
    Posted 2 years ago #

    I thought about that as well, but does .nocomment selector also hide the "No Comments" line?

    Angela

  5. Angela
    Member
    Posted 2 years ago #

    The edit function disappeared? Anyway, I guess I will just post a new reply here. I changed the code from

    <?php else : // Comments are closed ?>
    <p><?php  _e('Sorry, the comment form is closed at this time.') ; ?></p>
    <?php endif; ?>

    I used inline CSS and changed it to the following:

    <?php else : // Comments are closed ?>
    <style type="text/css" media="screen">
    h2 #comments, ol #commentlist {
    	display: none;
    }
    </style>
    <?php /*echo "<p>" . _e('Sorry, the comment form is closed at this time.') . "</p>";*/ ?>
    <?php endif; ?>

    Still not working, even though I do see the inline CSS show up (perhaps because it's processed after the <h2> tags?)

  6. Angela
    Member
    Posted 2 years ago #

    I guess I didn't need the comment to show up on pages, so I just disabled comment_template on the page.php. Wasn't really a perfect solution, but I will stick to it for now.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags