enable on custom included posts
-
in the first test the
Post container selectorsetting was empty.
(as i only have one page with with comments included..)i now also tried it with this setting set:
article.page, article.post, section.overlay-box
single page:09:24:33.996 [WP Ajaxify Comments] Initializing version 1.7.3 wp-ajaxify-comments.js:87:17 09:24:33.997 [WP Ajaxify Comments] Found jQuery 3.6.0 wp-ajaxify-comments.js:87:17 09:24:33.997 [WP Ajaxify Comments] Found jQuery blockUI 2.7 wp-ajaxify-comments.js:87:17 09:24:33.997 [WP Ajaxify Comments] Found jQuery Idle Timer plugin wp-ajaxify-comments.js:87:17 09:24:33.998 [WP Ajaxify Comments] Multiple comment form support enabled (selector: 'article.page, article.post, section.overlay-box') wp-ajaxify-comments.js:87:17 09:24:33.999 [WP Ajaxify Comments] Attach form... wp-ajaxify-comments.js:87:17 09:24:34.000 [WP Ajaxify Comments] Search comment form (selector: '#post-186 ~ .comments-area .comment-form, .comments-area .comment-form')... Found: Object { 0: form#commentform.comment-form , length: 1, prevObject: {…} } wp-ajaxify-comments.js:87:17 09:24:34.003 [WP Ajaxify Comments] Search comments container (selector: '#post-186 ~ .comments-area, .comments-area')... Found: Object { 0: div.comments-area.default-max-width.show-avatars , length: 1, prevObject: {…} } wp-ajaxify-comments.js:87:17 09:24:34.005 [WP Ajaxify Comments] Search respond container (selector: '#post-186 ~ .comments-area .comment-respond, .comments-area .comment-respond')... Found: Object { 0: div#respond.comment-respond , length: 1, prevObject: {…} } wp-ajaxify-comments.js:87:17 09:24:34.005 [WP Ajaxify Comments] Search comment paging links (selector: '#post-186 ~ .comments-area [class^='nav-'] a, .comments-area [class^='nav-'] a')... Not found wp-ajaxify-comments.js:87:17 09:24:34.008 [WP Ajaxify Comments] Search comment links (selector: '~ .comments-area a[href*="/comment-page-"], .comments-area a[href*="/comment-page-"]')... Not found wp-ajaxify-comments.js:87:17 09:24:34.009 [WP Ajaxify Comments] Initialization completedmy main page:
09:25:20.865 [WP Ajaxify Comments] Initializing version 1.7.3 wp-ajaxify-comments.js:87:17 09:25:20.865 [WP Ajaxify Comments] Found jQuery 3.6.0 wp-ajaxify-comments.js:87:17 09:25:20.865 [WP Ajaxify Comments] Found jQuery blockUI 2.7 wp-ajaxify-comments.js:87:17 09:25:20.866 [WP Ajaxify Comments] Found jQuery Idle Timer plugin wp-ajaxify-comments.js:87:17 09:25:20.866 [WP Ajaxify Comments] Multiple comment form support enabled (selector: 'article.page, article.post, section.overlay-box') wp-ajaxify-comments.js:87:17 09:25:20.869 [WP Ajaxify Comments] Initialization completed wp-ajaxify-comments.js:87:17i hope to find a way to enable the plugin for my custom page..
-
This reply was modified 4 years, 7 months ago by
s-light. Reason: fixed missing info
Hi @s-light,
Thanks for your request and sorry for the late reply. Can you please check the status of the JS variable WPAC._Options.commentsEnabled. If this variable is set to “false” WP-Ajaxify-Comments is not aware of the comment functions on your page. The plugin uses some WordPress logic to find out if comments are enabled on a specific page or not. If this magic does not work (maybe due to your custom theme setup), you can use the option “Comment pages URL regex” to define a regex that matches the URLs where comments are (also) enabled.
Hope this helps,
JanHi Jan,
thanks for your answer!
as you expected:11:41:44.291 WPAC._Options.commentsEnabled 11:41:44.313 falseseems the magic does not know about my *included* posts…
i tried to come up with an matching url –
but did not succedd…
i tried with
–https://localhost/mywebsite.de/
–https://localhost/
and
–https\:\/\/localhost\/
both not accepted by the form.
(and i think i maybe need to escape something more..)my special inclusion is on the static start page…
can you give a example of the regex to use?
sunny greetings
stefanThanks for the update.
You can checkout the source code here https://plugins.trac.wordpress.org/browser/wp-ajaxify-comments/trunk/wp-ajaxify-comments.php#L551. If you know PHP, you can try to debug the regex match.
If you need further support to set up the regex, we can offer you our professional developer support ($99/hour). If you are interested, please contact us here https://weweave.net/s/contact.
Best regards
JanHi Jan,
thanks for the link to the source.
jsut for reference for others finding this post:
the phppreg_matchfunction is used.
i used this online tester to quickly build & test my regex.
only think to look for:
the addon does not accept thegflag.i(=case insensitiv) is allowed:
so for me this one works:
/https:\/\/localhost\/mysite\.de\/.*/maybe you can add a example string like
/https:\/\/mysite\.de\/.*/(=matches all sites) to the explanation text..thanks Jan!
sunny greetings
stefanThanks for the update. The option should accept all flags as the option value is directly passed into the preg_match() function. The simplest way to just match all URLs, just use “.*” (without quotation marks).
hello ,
thanks for opening my closed eyes 😉
of course i can match just everything 😉i a saw in the code that it is directly parsed on –
and so you need to write
/.*/
as otherwise it is not a valid regex.
(maybe the/are lost in the forum-formatting process..but indeed the formula in the admin section is NOT accepting the
gflag.
/.*/iworks.
/.*/gshows the warning:Settings not saved! Please correct the red marked input fields.and the fieldComment pages URL regexis red.sunny greetings
stefan-
This reply was modified 4 years, 7 months ago by
s-light.
-
This reply was modified 4 years, 7 months ago by
The topic ‘enable on custom included posts’ is closed to new replies.
(@s-light)
4 years, 7 months ago
i have a childtheme setup where i custom include posts in my main page.
after some long tweaking i now have the (mainly) default comments.php included there and it shows up fine.
if i load a single page with comments enabled i get
and the ajaxify works.
if i load my special main page i only get
but if just search for the form i also find it in the dom:
what / when exactly is the script searching for the forms?
any tips are welcome 🙂