• Resolved s-light

    (@s-light)


    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

    
    13:19:19.962 [WP Ajaxify Comments] Initializing version 1.7.3 wp-ajaxify-comments.js:87:17
    13:19:19.962 [WP Ajaxify Comments] Found jQuery 3.6.0 wp-ajaxify-comments.js:87:17
    13:19:19.962 [WP Ajaxify Comments] Found jQuery blockUI 2.7 wp-ajaxify-comments.js:87:17
    13:19:19.963 [WP Ajaxify Comments] Found jQuery Idle Timer plugin wp-ajaxify-comments.js:87:17
    13:19:19.963 [WP Ajaxify Comments] Attach form... wp-ajaxify-comments.js:87:17
    13:19:19.964 [WP Ajaxify Comments] Search comment form (selector: '.comment-form')... Found:  
    Object { 0: form#commentform.comment-form
    , length: 1, prevObject: {…} }
    wp-ajaxify-comments.js:87:17
    13:19:19.967 [WP Ajaxify Comments] Search comments container (selector: '.comments-area')... Found:  
    Object { 0: div.comments-area.default-max-width.show-avatars
    , length: 1, prevObject: {…} }
    wp-ajaxify-comments.js:87:17
    13:19:19.968 [WP Ajaxify Comments] Search respond container (selector: '.comment-respond')... Found:  
    Object { 0: div#respond.comment-respond
    , length: 1, prevObject: {…} }
    wp-ajaxify-comments.js:87:17
    13:19:19.969 [WP Ajaxify Comments] Search comment paging links (selector: '.comments-area [class^='nav-'] a')... Not found wp-ajaxify-comments.js:87:17
    13:19:19.969 [WP Ajaxify Comments] Search comment links (selector: '.comments-area a[href*="/comment-page-"]')... Not found wp-ajaxify-comments.js:87:17
    13:19:19.970 [WP Ajaxify Comments] Initialization completed
    

    and the ajaxify works.

    if i load my special main page i only get

    
    13:20:56.220 [WP Ajaxify Comments] Initializing version 1.7.3 wp-ajaxify-comments.js:87:17
    13:20:56.221 [WP Ajaxify Comments] Found jQuery 3.6.0 wp-ajaxify-comments.js:87:17
    13:20:56.221 [WP Ajaxify Comments] Found jQuery blockUI 2.7 wp-ajaxify-comments.js:87:17
    13:20:56.221 [WP Ajaxify Comments] Found jQuery Idle Timer plugin wp-ajaxify-comments.js:87:17
    13:20:56.222 [WP Ajaxify Comments] Initialization completed
    

    but if just search for the form i also find it in the dom:

    
    13:24:14.179 document.querySelector('.comment-form')
    13:24:15.850
    <form id="commentform" class="comment-form" action="https://localhost/oswald….de/wp-comments-post.php" method="post" novalidate="">
    

    what / when exactly is the script searching for the forms?

    any tips are welcome ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter s-light

    (@s-light)

    in the first test the Post container selector setting 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 completed

    my 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:17

    i hope to find a way to enable the plugin for my custom page..

    • This reply was modified 3 years, 2 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,
    Jan

    Thread Starter s-light

    (@s-light)

    Hi Jan,

    thanks for your answer!
    as you expected:

    11:41:44.291 WPAC._Options.commentsEnabled
    11:41:44.313 false

    seems 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
    stefan

    Thanks for the update.

    You can checkout the source code here https://plugins.trac.www.ads-software.com/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
    Jan

    Thread Starter s-light

    (@s-light)

    Hi Jan,

    thanks for the link to the source.
    jsut for reference for others finding this post:
    the php preg_match function is used.
    i used this online tester to quickly build & test my regex.
    only think to look for:
    the addon does not accept the g flag. 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
    stefan

    Thanks 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).

    Thread Starter s-light

    (@s-light)

    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 g flag.
    /.*/iworks.
    /.*/g shows the warning: Settings not saved! Please correct the red marked input fields. and the field Comment pages URL regexis red.

    sunny greetings
    stefan

    • This reply was modified 3 years, 1 month ago by s-light.
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘enable on custom included posts’ is closed to new replies.