-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wordpress functions #14
Conversation
Enqueue scripts and styles. Add class to post container. Create comment section from each paragraph in post.
This looks pretty slick. From the look of the code, I'm assuming it identifies the post container and paragraphs and adds the classes for you? This looks like a fantastic starting place for SideComments integration with WordPress. However, I'm not sure having this logic live right in the codebase is the right spot for it. I think a Github Wiki page with reference to a Gist would be a better place. I'll look at integrating this logic + explanation into the project documentation. Thanks for submitting this. :) |
I've gone head and made a full WP plugin for this (really rather awesome bit of) javascript. https://github.com/richardtape/wp-side-comments I'm not a huge fan of the way I have to mung everything together in the one JS file, but there you have it. The CSS needs some love, too. But it works as a proof of concept. |
Hey Eric, |
@dcondrey That sounds pretty cool. If you want to fire up another repository and turn that into a JS component, I'm game. Let me know. :D |
Hi all, I made another WP Side Comments (!) plugin for WordPress... Actually, I have another approach beacause I'am adding the CSS classes with jQuery before to fire SideComment.js. The only issue I see with this approach is that we'll be wrong if there is a content update (like adding a paragraph in the middle). But I think we can fix it later on. Check the github repo there : https://github.com/strategio/wpsidecomments |
Hi strategio, Nice implementation. My issue with the way you've implemented it (aside from the issue you've mentioned already) is that it means deferring dom changes to the front-end of the site. That can be incredibly slow on a really long page. That being said, it's always good to have different approaches. Good luck with yours! :) |
Hi Richard, I don't think that adding an id for each paragraph is a big issue when there's a lot of work for SideComment script. First I thought about filtering the post content, and finally I didn't because some WordPress installations don't use paragraphs. I had a look at your code and I think we agree with quite everything. I would just suggest you to create your own query for comments to limit database calls, that's what I did. I hope we can share some work ! |
@dcondrey any chance you have the changes you made to replicate the commenting highlighting stuff that medium has? Would be nice to see the changes :) |
Enqueue scripts and styles. Add commentable-container class to post containers via post_class filter. Create comment section from each paragraph in post within incremental section_id.