IFBook / commentpress-core

CommentPress Core is a WordPress plugin for creating and debating social texts in social contexts. It replaces all previous plugins (standalone and multisite) and includes the default theme. Compatible with WordPress Standalone and Multisite, BuddyPress and Groupblogs.
https://www.futureofthebook.org/commentpress
GNU General Public License v2.0
40 stars 10 forks source link

awful list of paragraphs with zero comment #73

Closed nise closed 7 years ago

nise commented 7 years ago

Having a list of remarks that say exactly the same makes no sense imo, e.g.

0 COMMENTS ON THE WHOLE PAGE 0 COMMENTS ON PARAGRAPH 1 0 COMMENTS ON PARAGRAPH 2 0 COMMENTS ON PARAGRAPH 3 0 COMMENTS ON PARAGRAPH 4 0 COMMENTS ON PARAGRAPH 5 0 COMMENTS ON PARAGRAPH 6 0 COMMENTS ON PARAGRAPH 7 0 COMMENTS ON PARAGRAPH 8 0 COMMENTS ON PARAGRAPH 9 0 COMMENTS ON PARAGRAPH 10

Therefore, in commentpress-core/commentpress-core/assets/includes/theme-functions.php on line 2430 these remarks could be put under the condition of having more then one comments:

if($comment_count > 0){
    echo '<h3 id="para_heading-' . $text_sig . '"' . $no_comments_class . '><a class="comment_block_permalink" title="' . $markup['permalink_text'] . '" href="#para_heading-' . $text_sig . '">' . $markup['heading_text'] . '</a></h3>' . "\n\n";
}
christianwach commented 7 years ago

@nise Unfortunately excluding the markup when there are no comments won't work since there won't be anything to reveal once a comment has been submitted on a relevant paragraph.

However your observation is very timely because I have just implemented a solution to this in the latest release. Please refer to this support ticket on the WordPress site where you'll see that the following CSS in a child theme will have the desired effect:

.no_comments {
    display: none;
}

I'll implement this as an admin option in the next release. I'll make it optional at this stage because some people like to navigate the content of a page using these headers.

Cheers, Christian

nise commented 7 years ago

You are right my solution did not work for new comment. Thank you for the css hint.