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.
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.
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!