Jump to content
Sign in to follow this  
awww

Correct comment counts with using Simple:Press?

Recommended Posts

awww

I use Simple:Press, an advanced plugin that integrates a discussion forum into a WordPress site. One cool feature is that blog posts can appear in the forums and then comments in the forums also appear on the blog posts. Neat! But on the blog post, comments originating in the forum are not counted. So this blog post, which has a number of forum comments, shows "1 Comment" at the top and "One Response to..." at the bottom -- even though there are bunches of comments brought over from the forums. http://www.waywordradio.org/kit-caboodle/ I posted a question about it to the Simple:Press forums and developer Andy Staines responded:

It depends how your WP comments template retrieves and displays the comment count. The most common is by using the WP template tag comments_number(). If this is the case then this can be replaced by:
spCommentsNumber("0 Comments", "1 Comment", "% Comments", true);

which has the same format but wll add the topic posts and blog comments together.

I don't really see a way to integrate that SP function into PL without hacking the core PL template code. Can you help suggest a route for properly counting comments? It's niggling at my sense of order. SImple:Press is version 5.2.1and PageLines is 2.2.5. The problem existed in earlier versions of both. WordPress is at 3.4.1.

Share this post


Link to post
Share on other sites
Simon
We use http://codex.wordpress.org/Template_Tags/get_comments_number In comments.php [code]printf( _n( 'One Response to %2$s', '%1$s Responses to %2$s', get_comments_number(), 'pagelines' ),[/code]

Share this post


Link to post
Share on other sites
awww
Simon, if I modify that file I risk having the modification wiped out by the next PL update, right?

Share this post


Link to post
Share on other sites
catrina
If you put that code in a core file (instead of a copy of the file in the base theme), it can be wiped by the next PL update. This is why the base theme is very handy. :)

Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
Simon
install the base theme, and copy comments.php into the child themes folder, WordPress will use that then instead of the core one.

Share this post


Link to post
Share on other sites
awww
I installed the base theme from the store, but it doesn't appear in the WP Themes folder. Shouldn't it?

Share this post


Link to post
Share on other sites
Danny
Hi Grant, The base theme should be in: wp-content/themes/ and should be called "pagelines-template-theme"

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
awww
Excellent, that did it for the comment count that occurs right before the comments. Now there's the count that looks like "Posted April 7, 2012 ?· 2 [Edit]", where the 2 is the number of comments. It's right under the title. That looks like part of the page. Is that one also modifiable?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×