Comments Plus hooks and Divi by Elegant Themes

Hello! I'm trying to install Comments Plus plugin and everything else seems clear to me but the comments do not appear anywhere. I think that I should change Start injection hook and Finish injection hook. Where do I find the correct values? I tried to search this site and the Elegant Themes support site but with no luck so far.

  • Sajid

    Hi Laura,
    Hope you are doing good today :slight_smile:

    It depends what template your theme is using for comments. If you know what template is it then add the following code before the comments start:

    <?php
    		/**
    		 * Fires before the comment form.
    		 *
    		 * @since 3.0.0
    		 */
    		do_action( 'comment_form_before' );
    		?>

    ..and following code where it ends the comment form.

    <?php
    		/**
    		 * Fires after the comment form.
    		 *
    		 * @since 3.0.0
    		 */
    		do_action( 'comment_form_after' );
    		 ?>

    If you are not sure what is your template then you can send me the theme package download links (both parent and child themes) and I will give you the updated code/theme accordingly.

    You can send in the theme(s) download link privately by using our contact form and marking it to my attention.
    Subject: "Attn: Sajid Javed"
    -download links of both themes
    -link back to this thread for reference
    -any other relevant urls
    Select "I have a different question" for your topic (see screenshot) - this and the subject line ensure that it gets assigned to me.

    Take care and have a nice day :slight_smile:
    Cheers, Sajid

  • Sajid

    Hello Laura,
    Hope you are doing good :slight_smile:

    Thanks for sending in the working credentials. I have fixed the issue by following the steps below.

    1. Enabled comments from Admin -> Settings -> Discussion -> Default article settings -> Allow people to post comments on new articles.

    2. Enabled comment on this article:
    http://www.tekila.fi/2016/08/16/maidoton-munaton-ja-gluteeniton-rapea-vohveli/

    3. Added following code in custom.js file of your parent them:

    comments_twit = $this_link.is( '#comment-provider-twitter-link' ),
    				comments_fb = $this_link.is( '#comment-provider-facebook-link' ),
    				comments_gp = $this_link.is( '#comment-provider-google-link' ),
    
    				disable_scroll = has_closest_smooth_scroll_disabled || has_closest_woocommerce_tabs || has_closest_eab_cal_link || has_acomment_reply || comments_twit || comments_fb || comments_gp;

    4. Also, disabled this option "Pages on my website already use javascript from Facebook" from Admin -> Settings -> Comments Plus -> Facebook options.

    Now, its displaying and working just fine on your website.

    Take care and have a nice day :slight_smile:

    Best Regards,
    Sajid

  • Sajid

    Hi Laura,
    Hope you are doing good today :slight_smile:

    That is not the issue of comments + plugin or a theme conflict. Its becase your Facebook app is not live for the public and also you have not set contact email.

    Here are the steps to make it public.

    STEP 1:

    In Facebook App -> Settings -> Basic -> Contact Email. (Give your email - as seen in attached screenshot below)

    STEP 2: In Facebook App -> Review tab change Your app is in development and unavailable to the public. to Yes.

    And cheers ..

    Best Regards,
    Sajid

  • Shayne

    Hi,

    I have run into the exact same issue as Laura originally posted where Comments+ doesn't quite work well with the Divi theme. However, the posted fix does resolve my issue.

    comments_twit = $this_link.is( '#comment-provider-twitter-link' ),
    				comments_fb = $this_link.is( '#comment-provider-facebook-link' ),
    				comments_gp = $this_link.is( '#comment-provider-google-link' ),
    
    				disable_scroll = has_closest_smooth_scroll_disabled || has_closest_woocommerce_tabs || has_closest_eab_cal_link || has_acomment_reply || comments_twit || comments_fb || comments_gp;

    My question is... is there a way to accomplish this without modifying core files of the theme? The divi theme is updated regularly. I do have a child theme created but I'm not quite sure how to replicate this into the child theme (the custom.js is not part of it). Or would it be possible to create a simple mu plugin?

    Thanks!
    Shayne

  • Nastia

    Hello, Shayne, I hope you are doing well today!

    Thank you for posting in this thread, however, because this issue is resolved for the original author that has posted it, please, next time create a new one. This way, the author will not be getting email notifications each time when there is a new post in the thread.

    You can create a new thread here:
    https://premium.wpmudev.org/forums/#question

    is there a way to accomplish this without modifying core files of the theme?

    You will need to create a child theme to override the theme's JS files. I found several links with explanation:
    http://stackoverflow.com/questions/24430903/overriding-parent-theme-javascript-from-child-theme
    http://themes.simplethemes.com/skeleton/tutorials/how-to-add-custom-css-and-javascript-using-a-child-theme/

    Basically yo will need to add to functions.php of your child theme the following:

    // Load Custom JavaScript via Child Theme
    function my_custom_javascript() {
        wp_enqueue_style('myscript', get_stylesheet_directory_uri().'/js/custom.js', array('jquery'), '1.0', 'screen, projection');
    }
    add_filter('child_add_javascripts','my_custom_javascript');

    And create js file in your child theme directory woth the JS code.

    I hope this will help!

    Cheers,
    Nastia

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.