Skip Navigation

[Resolved] Create view to display facebook comment box with post url

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to display a Facebook Comments element in my single post template, but I would like to show the same comments for all languages of this post. I am using a URL parameter to differentiate languages.

Solution: Elementor's FB Comment element does not seem to differentiate between different URL parameters, so the same comments show for all languages.

This support ticket is created 6 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by Vikram 6 years ago.

Assisted by: Christian Cox.

Author
Posts
#1165683

Using WPML the website is multilingual. Using Toolset I am creating custom post type and want to keep only Facebook comments below the post. The post url for different languages is made distinct through parameter in end.
(e.g. [mycustomposturl]?lang=en or [mycustomposturl]?lang=hi )
But for all languages of any particular post, the facebook comment box should be common i.e. only [mycustomposturl] excluding those ending language parameter.

Now I am creating Single post template using page builder (Elementor) in which I can add other custom fields easily but for this facebook comment box I am not sure which way would be best approach?

I thought of creating view where I added post url from fields. Following is the code:

[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
<div class="fb-comments" data-href='[wpv-post-url]' data-numposts="5"></div>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

Unfortunately this is not working and in output it displays No items found. I even tried to explicitly store custom post url in another custom field and used that in "data-href" but nothing works. I can't figure out where am I going wrong.

Kindly suggest me how should I create and use views in Elementor Single Post Template to display the facebook comment box.

Regards.

#1165809
Screen Shot 2018-12-13 at 4.22.35 PM.png

URLs with different parameters do not seem to be considered different posts by the Elementor Facebook Comment element. As a test, I just tried this out by placing the Elementor Facebook Comment element in a single post template for Projects post type. I have chosen "Plain permalink" in the Elementor settings for URL Format, and "Current Page" for the Target URL. Then I tested at all 3 of these URLs:
hidden link
hidden link
hidden link

No matter which URL I am viewing when I submit a comment, the comment appears in all the posts. So I don't see any problem with placing the Facebook Comment element in the single post template, as it will show comments for all language posts when you use a URL parameter to specify post language in WPML.

#1166176

I was in same doubt about Elementor Facebook Comment element and didn't test it assuming it will consider separate url for each language. So now there is more easy option. That's great! My issue is resolved now. Thank you!