Title: Pulling Permalink Into Facebook Comment Code
Last modified: August 20, 2016

---

# Pulling Permalink Into Facebook Comment Code

 *  [jaygabler](https://wordpress.org/support/users/jaygabler/)
 * (@jaygabler)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/pulling-permalink-into-facebook-comment-code/)
 * I use a Facebook Like button and comments on my site [Unreality House](http://www.unrealityhouse.com)
   by inserting the comment block code into the footer widget. The Like button works
   fine, but currently the comments display the same all over the site. I’m aware
   that this is because I have a fixed URL in the data-href parameter (see code 
   below). I’m aware that I need to replace that with code to pull the individual
   post permalink. Here’s my problem: no code that I’ve tried works. I’ve tried 
   putting <?php the_permalink(); ?> and <?php get_permalink(); ?> and ‘, get_permalink(),’
   and ‘, the_permalink() ,’ in the double quotes, but in every instance the comment
   block on the site says that “[http://invalid-invalid](http://invalid-invalid)
   is unreachable.” I’ve been poring through help forums for an hour, and I can’t
   find anything that would explain why that permalink code, which seems to work
   for everybody else, isn’t working for me. Any ideas?
 * <div id=”fb-root”></div>
    <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(
   s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id;
   js.src = “//connect.facebook.net/en_US/all.js#xfbml=1”; fjs.parentNode.insertBefore(
   js, fjs); }(document, ‘script’, ‘facebook-jssdk’));</script> <div class=”fb-comments”
   data-href=”[http://www.unrealityhouse.com&#8221](http://www.unrealityhouse.com&#8221);
   data-num-posts=”10″ data-width=”500″></div>

The topic ‘Pulling Permalink Into Facebook Comment Code’ is closed to new replies.

## Tags

 * [Comments](https://wordpress.org/support/topic-tag/comments/)
 * [get_permalink](https://wordpress.org/support/topic-tag/get_permalink/)
 * [permalink](https://wordpress.org/support/topic-tag/permalink/)
 * [the_permalink](https://wordpress.org/support/topic-tag/the_permalink/)

 * 0 replies
 * 1 participant
 * Last reply from: [jaygabler](https://wordpress.org/support/users/jaygabler/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/pulling-permalink-into-facebook-comment-code/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
