Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1061412

    Hi,
    I would like to add comments to posts build with ALB, but not in the Backend.
    Right now I’m using a function which hooks to ava_before_footer to add additional content to a an ALB post.
    Comments are only working, if I add them in the Backend (ALB Element).

    But they are not working if for example I add them to my function like this:
    echo do_shortcode("[av_comments_list av-desktop-hide='' av-medium-hide='' av-small-hide='' av-mini-hide='' av_uid='av-1w2tnu']");
    or like this:
    comment_form( $args, $postid );
    or like this:
    comments_template();

    I’m guessing it has something to do with the av_uid which has to be assigned somehow.
    Really need advice here. Thanks!

    EDIT 1: to be clear…”do_shortcode” shows the comments, but NOT the comments form. also it shows “comments are closed” even if they are definitely not.

    EDIT 2: here https://kriesi.at/documentation/enfold/comments/ it says:
    [av_comments_list av-desktop-hide='' av-medium-hide='' av-small-hide='' av-mini-hide='' av_uid='av-79s2f5']
    which is exactly what I’m trying.

    • This topic was modified 5 years, 9 months ago by freddyB.
    #1063898

    Hey freddyB,

    Thank you for using Enfold.

    Post the whole snippet that you’re using on pastebin.com so that we can test it on our end. Did you enable the “Allow Comments” option for the posts?

    Best regards,
    Ismael

    #1064495

    Hey Ismael,

    this is what I put in functions.php: https://pastebin.com/sskpNaJD

    The result is very strange. It outputs the comments BUT NOT the comment form. Instead it shows: comments are closed.
    (also tested with comments_open(), which returns FALSE)
    But comments are 100% open.
    “Allow Comments” is set to TRUE in the post settings. (even checked it in the database)
    Discussion is also enabled sitewide.
    Latest WP and Enfold.

    It has to be something with ALB mode.
    Only if I add a Comments sections in the Backend the do_shortcode one in functions.php is also working.

    #1065343

    Hi,

    Thanks for the update.

    This is probably an issue with a filter that the theme is using. Please add this in the functions.php file:

    add_action( 'after_setup_theme', function() {
          remove_filter( 'comments_open', 'av_comments_on_builder_posts_required', 10, 2 );
    }, 10 );
    

    Let us know if it helps.

    Best regards,
    Ismael

    #1065923

    Hi Ismael,

    yes, it’s working now. Thank you!
    Topic can be marked as solved and closed.

    #1065931

    Hi!

    Great! Glad it worked. Please feel free to open a new thread if you need anything else.

    Have a nice day!

    Best regards,
    Ismael

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Comments in posts with ALB through functions.php’ is closed to new replies.