A WordPress site has recently changed from .co.uk to .org. As soon as this was done, it affected Facebook Comments data as the URL it was mapped to had changed. This is the code within single.php to call the comments:
<div class="fb-comments" data-href="<?php the_permalink() ?>" data-num-posts="3" data-width="620"></div>
Now that the_permalink() has changed, I want to output the following as a function:
if post is published before 29th Jan 2012 output this:
<div class="fb-comments" data-href="http://www.domain.co.uk/post-permalink/" data-num-posts="3" data-width="620"></div>
otherwise output this:
<div class="fb-comments" data-href="http://www.domain.org/post-permalink/" data-num-posts="3" data-width="620"></div>
Ok to start with
Step 1: Open the theme folder you are using.
Step 2: Open the function.php in any editor and copy the following function there.
Step 3: Now save it and open your loop-single.php or single.php where you have placed your facebook comment div and replace that with the following code.
Step 4: Save it and Run.
This will definitely work.
Enjoy.
Thanks
Rahul.