mirror of
https://github.com/Frumph/comic-easel.git
synced 2026-07-23 01:46:02 -04:00
[GH-ISSUE #8] Link to comments in navigation does not show number for current page #9
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @EmilyRyan on GitHub (Jul 27, 2014).
Original GitHub issue: https://github.com/Frumph/comic-easel/issues/8
In the Comic Easel config there is an option that I left activated:
Enable the comment link in the comic navigation?
When this is enabled, a link will appear in the navigation that lets you go to the comments section of the current post, it also shows how many comments there currently are.
Problem is, on each comic page of my site except the main page, the parenthesized number shows the total amount of comments I have received (2) on a different page, this one: http://emilyryan.se/gramarye/comic/the-roster-of-names/
Whether this is a bug or me setting up the URL:s wrong I can't say, but I thought I'd report it just in case.
@Frumph commented on GitHub (Oct 22, 2014):
It appears to be working properly, what it does it go to the section of the single comic page for it and then moves the browser to the comments area
@EmilyRyan commented on GitHub (Oct 22, 2014):
Just to clarify: for me, the number in the parenthesis does not show the number of comments for the current page, but a different one, so it becomes misleading. I thought it was a problem with my php-files but the same problem is exhibited here: http://comiceasel.com/comic/segway/#comments
This is a detail of course. Thank you for your hard work!
@Frumph commented on GitHub (Oct 22, 2014):
The link you provided shows 0 comments and has 0 comments ... on the comiceasel.com site
@EmilyRyan commented on GitHub (Oct 23, 2014):
Yes, the Segway link has 0 comments, so it's not completely the same, I only provide it as an example of other things that seem odd: when I click the comment button my browser (Chrome or Firefox) window doesn't jump to a comments anchor.
If you look at this link instead, a page of mine without comments, it lists comment number as 2: http://emilyryan.se/gramarye/comic/im-strong-willed-just-not-right-now/
(The link I provided in the very first post was the only page with comments, i.e the only single page that works)
@Frumph commented on GitHub (Oct 23, 2014):
I see it now. - on your site.
.. that can happen if there was something taking over the filter, or the $post->ID gets corrupted but it's not .. it also can happen if you have trackbacks but are not showing those trackbacks.
Can I get a screen capture of your (wp-admin)dashboard -> comments - section?
@Frumph commented on GitHub (Oct 23, 2014):
As for the links not working, it's because the old version of Responsive you're using doesn't have the #comments ID showing unless there are actually comments there
http://emilyryan.se/gramarye/comic/the-roster-of-names/#comments This one works because there's actually comments. It's a bug in the theme that's causing the other's not working
@EmilyRyan commented on GitHub (Oct 23, 2014):
Is this the one you mean?

@Frumph commented on GitHub (Oct 23, 2014):
Yes, absolutely - Now we've narrowed it down to it not being trackbacks not-showing
So the next step is to check if you have any plugins that might be filtering the comments section - to do that, you basically disable and clear cache of all plugins except the comic easel plugin then you check the posts to see if it's still saying the (2) on it
@EmilyRyan commented on GitHub (Oct 23, 2014):
I use Akismet and Slim Jetpack. Akismet and Jetpack deactivated and cache emptied show no change for me yet.
@Frumph commented on GitHub (Oct 23, 2014):
Okay go ahead and put them back on clearing cache again - and thank you for helping me debug.
@Frumph commented on GitHub (Oct 23, 2014):
I made some changes to this github in the way of the comments appearing, if it still continue's then the only thing i can think of is that the theme is filtering the comments code changing the $post->ID to something other then it should be
@EmilyRyan commented on GitHub (Oct 23, 2014):
I have updated the injections.php, navigation.php and comiceasel.php on my server (the files I saw you had changed within the last hour). I don't see any change yet so I guess it's a problem with the theme.
Thank you for your help!
@Frumph commented on GitHub (Sep 28, 2015):
Still an issue?
@EmilyRyan commented on GitHub (Sep 28, 2015):
Yeah... no change. I don't know what to do.
http://emilyryan.se/gramarye/comic/the-roster-of-names/#comments isn't perfect either, the comments in the next, previous navigation should show (2).
@Frumph commented on GitHub (Sep 28, 2015):
unless two of them are pingbacks and not displayed
@EmilyRyan commented on GitHub (Sep 28, 2015):
No, I'm almost certain they aren't, or rather, it would be an incredible coincidence. Comments (4) is displayed on every page except the starting page. It is the total number of comments that I have on comic pages in total.
Page with zero comments showing (4): http://emilyryan.se/gramarye/comic/trail-of-seals/
Page with two comments showing (4): http://emilyryan.se/gramarye/comic/the-sheep-rises/
@Frumph commented on GitHub (Sep 28, 2015):
Your theme has a filter on it.
/core/includes/functions-extras.php
line: 67
add_filter( 'get_comments_number', 'responsive_comment_count', 0 );
if you encapsulate that line with /* */ (or) two // slashes in front of it to comment it out from running, tell me if it still happens
The function it runs is written wrong:
That should be global $post; and &post_id=' . $post->ID
Cause $id can't be guaranteed to have the right value inside of it with everything going on in a page, should not be used in this method
@Frumph commented on GitHub (Sep 28, 2015):
also (in addition to)
would make it so it only runs on sections that are 'in the main loop'
@EmilyRyan commented on GitHub (Sep 29, 2015):
I commented out line 67 and added && in_the_loop(). It works like a charm!
Thank you for the help, I would never have found it myself! Looking through other people's themes is beyond what anyone would hope for, so thank you.
@Frumph commented on GitHub (Sep 29, 2015):
$post and $post->ID replacing $id one and in_the_loop() is the fix ..
the commenting out the line only tests if that was where the problem was ;)
sorry I didn't make myself clearer heh
@EmilyRyan commented on GitHub (Sep 29, 2015):
This is what I did, everything seems to work:
: )
@Frumph commented on GitHub (Sep 29, 2015):
yeah but if you comment out line 67 it won't even run that ;/ so try it without 67 commented out if it breaks it again, recomment
@EmilyRyan commented on GitHub (Sep 29, 2015):
Forgot to say; I also removed the comment!
@Frumph commented on GitHub (Sep 29, 2015):
\o/ yay hehe