0

I am using plugin "wpdevart facebook comment" for posting comments at the end of every post. They are displaying good But now I want to shift those comments little below of pagination and ads Or at the end of the page but comments should be of the relevant post. attached is the screenshot: enter image description here

And for this I have added the plugin shortcode in the Single.php

while ( have_posts() ) : the_post();

                    $bimber_post_settings = bimber_get_post_settings();
                    bimber_set_template_part_data( $bimber_post_settings );

                    /*
                     * Include the post format-specific template for the content. If you want to
                     * use this in a child theme, then include a file called called content-single-classic-___.php
                     * (where ___ is the post format) and that will be used instead.
                     */
                    get_template_part( 'template-parts/content-single-classic', get_post_format() );
                    comments_template();
                    //facebook comments
                    echo do_shortcode('[wpdevart_facebook_comment facebook_app_id="12345678910111213" curent_url="http://developers.facebook.com/docs/plugins/comments/" order_type="social" title_text="Facebook Comment" title_text_color="#000000" title_text_font_size="16" title_text_font_famely="Arial" title_text_position="left" width="100%" bg_color="#000000" animation_effect="none" count_of_comments="10" ]');

                    bimber_reset_template_part_data();

                endwhile;
                ?>

But It displays all comments of all posts and pages.

0

From the plugin's user manual.

Curent_url - Type the page URL from where you need to show Facebook comments

So you will have to change the current URL which is (http://developers.facebook.com/docs/plugins/comments/) to your real current URL.

global $wp;
$current_url = home_url( add_query_arg( array(), $wp->request ) );
echo do_shortcode('[wpdevart_facebook_comment facebook_app_id="12345678910111213" curent_url="'.$current_url.'
    " order_type="social" title_text="Facebook Comment" title_text_color="#000000" title_text_font_size="16" title_text_font_famely="Arial" title_text_position="left" width="100%" bg_color="#000000" animation_effect="none" count_of_comments="10" ]');
  • Its not getting the already posted comments which means its only getting the comments that are submitting now. – Noman Ahmad Aug 13 '18 at 17:30
  • try to echo $current_url and be sure it's the right URL, also keep in mind I am using my app_id. – Castiblanco Aug 13 '18 at 17:49
  • I just checked your site, and the URL has a lot of blank spaces at the end, that may be a problem. i.imgur.com/YTDBjmN.png – Castiblanco Aug 13 '18 at 17:52
1

Well, you can move comments div out of the "single.php" wrapper.

Changle location of this shortcode echo do_shortcode('[wpdevart_facebook_comment facebook_app_id="12345678910111213" curent_url="http://developers.facebook.com/docs/plugins/comments/" order_type="social" title_text="Facebook Comment" title_text_color="#000000" title_text_font_size="16" title_text_font_famely="Arial" title_text_position="left" width="100%" bg_color="#000000" animation_effect="none" count_of_comments="10" ]');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.