How to Change Domain But Retain Facebook Likes
-
Hi all,
We are just moving out of beta and must change our domain name (bummer) but do not want to loose our thousands of facebook likes.
HTML code on our page for the likes is as follows:
<iframe frameborder=”0″ scrolling=”no” allowtransparency=”true” style=”border:none; overflow:hidden; width:50px; height:65px;” src=”https://www.facebook.com/plugins/like.php?href=https://example.com/story1/&layout=box_count&show_faces=true&width=50&action=like&font=arial&colorscheme=light&height=65″>
</div>PHP code (sharebox.php) for likes inside the sharebox wrapper looks like this:
<div class=”panel” title=”Like on Facebook”>
<iframe src=”https://www.facebook.com/plugins/like.php?href=<?php echo rawurlencode(get_permalink()); ?>&layout=box_count&show_faces=true&width=50&action=like&font=arial&colorscheme=light&height=65″ scrolling=”no” frameborder=”0″ style=”border:none; overflow:hidden; width:50px; height:65px;” allowTransparency=”true”></iframe>
</div><?php } ?>
The href defaults to the current page/permalink normally but I would like to be able to use a wordpress custom field to insert our old page url for articles pre domain switch and revert back to the current permalink for post domain switch posts.
Can anyone suggest an approach for this? I am not a coder unfortunately.
Alternatively, if there is another way of doing this that would be great too.
- The topic ‘How to Change Domain But Retain Facebook Likes’ is closed to new replies.