Hi all,
I’m currently converting this WordPress theme to EE, trying to optimize everything as much as possible while doing so.
If you look at this template from the demo-site, you’ll see the comments section at the bottom.
At the top of this section, there is a count of the comments made - seven in this case. I’d love to save an {exp:channel:entries} query, just to get this count, but of course
{comment_total}...needs one, to count how many comments have been made.
What I’m wondering is: Can I get that count using the {exp:channel:entries} query I already have pulling the article entry further up on the page, save it in a variable, and then use it later down in the comments section? Or some other way, that does not require me to “spend” a query, just to get this count?
It may seem like I’m going too far in my optimization, but such a technique could be very handy in a million other situations, where the benefit may be greater.
If EE does not have this functionality, perhaps a third-party add-on exists? I’ve tried looking for one on Devot:ee but had a little trouble figuring out what to search for, so if anyone knows of an add-on that does this, I’d love to hear about it 😊
However, it preferably should be Open Source, or at least free with a kind developer. The reason for this is, that the theme will be released for free to the community when done (the first in a series of free themes, more about that here) and I’d like to include the add-on in the download, so the user won’t have to install anything separately.
Anyways, hope you all have some ideas, thank you very much in advance!
Cheers,
Thomas