• Resolved Angela

    (@angelazou)


    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/

Viewing 5 replies - 1 through 5 (of 5 total)
  • sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

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

    sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    It looks like this would do it.

    .nocomments {
    display: none;
    }
    Thread Starter Angela

    (@angelazou)

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

    Angela

    Thread Starter Angela

    (@angelazou)

    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?)

    Thread Starter Angela

    (@angelazou)

    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Theme: Liquorice] Comment.php Modified, Sidebar Disappeared’ is closed to new replies.