How to link to Discourse topics without displaying comments

wordpress

(Simon Cossar) #1

The WP Discourse plugin now has an option to link to Discourse topics without displaying comments underneath the post. This is enabled by selecting the Link to Comments Without Displaying Them option from the plugin’s Commenting settings tab. When you do that, you will find something like this displayed underneath your posts:
20%20PM

That doesn’t look great, but you can add some styles to the link by targeting the .wpdc-join-discussion-link class.

01%20PM

As comments are added to the Discourse topic, the link text will be updated with the comments number:

28%20PM

10%20PM

The text for the link can be customized through the plugin’s Text Content settings tab. The three settings that control the text are Join Discussion Link: no Comments, Join Discussion Link: Comments Singular, and Join Discussion Link: Comments Plural.

To further control the display of the link, you can hook into the wpdc_join_discussion_link_text filter. It is passed three parameters: $link_text (the text is based on the number of comments), $comments_count, and $post_id.


"Link to Comments Without Displaying Them" option not working