Comment Count Element Not Found
-
Hello, Custom Layouts Support,
Is Comment Count supposed to display under the Post Template Editor Elements list?
If not, how do you add this element?
Thank you for your assistance.
Regards,
Michael McIntoshThe page I need help with: [log in to see the link]
-
Custom Layouts Support,
Perhaps my question should be:
How do I add the comments number (number of comments the post has) to the post metadata? I have noticed that post metadata items can be fetched using a custom field element.Your assistance would be very much appreciated.
Regards,
Michael McIntoshHey @mtosh
This element as actually not available yet.
I half built it and planned to release but it didn’t quite make it to release yet (and no one asked for it).
I’ll get this included in an update I’m planning on Friday 🙂
Best
Hi, @codeamp,
And, thanks for your willingness to add this element!
Until it is added, can you recommend a resource that displays the correct coding to add the get_comments_number (or other, whatever works) to the post meta of all posts, so it can be fetched with a custom field element?
I have tried countless code examples (even the ones from WordPress) and can get nothing to work.
Your assistance is appreciated.
Regards,
@mtoshHey @mtosh – I don’t think the count number is in post meta.. I think you can get it with this:
https://developer.wordpress.org/reference/functions/get_comments_number/Best
Hi, @codeamp,
I tried adding the coding there [function get_comments_number…] to functions.php but it caused an error.
For an example of what works, when I installed the WP plugin, HeartThis, it added its “Key” to the Post MetaData of all posts, so I was able to fetch that data (the number of “Likes” a post has) with your Custom Field element.
So, do you have any idea of how I can add a Post MetaData Key for the number of comments a post has, so I can fetch that data with your Custom Field element?
Thank you for your assistance.
Regards,
@mtoshHey @mtosh
I think it’s going to be pretty complicated to do that, as you’d need to find a way to save the comment count (and keep it updated whenever someone comments) in the post meta, in order to use our custom field element for it.
I’ll get on with finishing this comment count element, it’s looking like Friday / Monday at the moment 🙂
Best
@mtosh just to let you know we’re nearly finished building this and shortly on to testing – I think we will release it tomorrow.
Best
Hey @mtosh
We’re still testing/tweaking a few things to do with this update so won’t be releasing just yet.
If you’re interested you can grab the beta from here (which has the comment count element): https://drive.google.com/file/d/1PSVawXeqjYXncy6Qc3MfB9B_jRdT_IB1/view?usp=sharing
Best
Thanks so much, @codeamp,
The beta version works great for me! Thank you for including the comments number element! Now my headache will subside (smiley face)
If I may be so bold as to mention a feature request for future updates–it would be great if you included the ability to insert images (to represent a comment bubble, for example) before or after elements so we are not restricted to unicode text.
With appreciation again,
@mtoshHey @mtosh
Just to let you know the official udpate just landed, feel free to upgrade – you probably won’t notice much difference.
Regarding your suggestion – absolutely – we’re planning on supporting the full block library at some point – so the idea is, you could create a “row”, add in your icon, and add in your template element next to it.
For now though, you could try adding icons with CSS as outlined in this post:
https://wordpress.org/support/topic/dash-icon-before-taxonomy/#post-14376048I’ll close this ticket for now then!
PS, I’m trying to get feedback and reviews for this plugin – yours would be most appreciated if you are so inclined – https://wordpress.org/support/plugin/custom-layouts/reviews/#new-post
Best
– Ross
The topic ‘Comment Count Element Not Found’ is closed to new replies.