Support » Plugin: Collapse-O-Matic » Collapse comment section

  • Resolved guiguilyon



    Can this plugin collapse the comment section of every post or page of a website?

    I guess I could put a shortcode on every single post. But it would be too long. Could it be in the theme instead?


Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author twinpictures


    Yes, you would need to modify the child-theme, but it can be done.
    here is thread with some examples:

    Thanks for the really quick response!

    But I’m still a noob with this. The instruction is unclear to me.

    1. Collapsible comments
    Replace comment area with something like the following:

    Can you be more precise and please tell me in which file of my child theme I should add the code? Should it be added to it or replace something?


    • This reply was modified 1 year, 2 months ago by guiguilyon.


    I got some help on my themes forum (Weaver Xtreme).
    They said I have to go to comments.php of the theme and replace

    echo ‘<div id=”comments”>’;


    echo ‘<div id=”comments”>’;
    echo ‘<div id=”commentCollapse” class=”collapseomatic”>’;


    echo “</div><!– #comments –>\n”;


    echo “</div></div><!– #comments –>\n”;

    I also added the code provided here

    <span id=”commentCollapse” class=”collapseomatic”>
    if ( comments_open() ) :
    comments_popup_link(‘Leave a comment ↓’, ‘1 comment ↓’, ‘% comments ↓’);
    <span id=”swap-commentCollapse” class=”collapseomatic” style=”display: none;”>Collapse ↑</span>
    <?php edit_post_link(‘Edit →’, ‘| ‘, ” ); ?></p>

    <div class=”content_collapse_wrapper”><div id=”target-commentCollapse” class=”collapseomatic_content force_content_collapse”>
    <?php comments_template( ”, true ); ?>

    Nice ! Now the comments section is hidden. But I can’t display it at all. There is no button to make it appear.

    Do you have any idea to help me please? 🙂

    The test website I’m testing thjis on is here

    Plugin Author twinpictures


    well, good for you for giving this a go!
    on the page you linked to, we see that the<span id=”commentCollapse” class=”collapseomatic”>... is wrapped in a <style> tag. This is not good.

    Remove the wrapping <style> tags and we’ll take another look.

    Plugin Author twinpictures


    Again, just to be extra-clear: the issue is that the code you added is being wrapped in a style tag:

    <span id="commentCollapse" class="collapseomatic">
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Collapse comment section’ is closed to new replies.