Home › Forums › Support › What is the Permalink PHP code on Generate Press theme? This topic has 7 replies, 4 voices, and was last updated 3 years, 1 month ago by Elvin. Viewing 8 posts - 1 through 8 (of 8 total) Author Posts January 20, 2021 at 4:17 am #1626100 Sibi Paul Hi… I would like to add Facebook comments to my site. <div class="fb-comments" data-href="<?php the_permalink();?>" data-width="100%" data-numposts="5"></div> I want to replace <?php the_permalink();?> with Correct generate Press code. Thanks. January 20, 2021 at 11:29 am #1626806 TomLead Developer Lead Developer Hi there, Themes have no say over the permalinks – WordPress handles it. If that element needs the current URL of the page to be displayed in that data attribute, then you’re already doing it right ๐ January 20, 2021 at 11:42 am #1626821 Sibi Paul When I replace this <?php the_permalink();?> with current URL… Then, FB Comments are Visible… But… When I use that code for Dynamic URL Pickup, it won’t work. for your Info… My site home directory having TagDiv’s Newspaper Theme But, I created an Additional Directory for generate press. (site details added below) January 21, 2021 at 9:48 am #1628171 TomLead Developer Lead Developer Are there any instructions for what you’re trying to do? Do they suggest using the_permalink()? February 18, 2021 at 9:09 pm #1663969 gulhio Hello everyone, I have that same problem. <? php the_permalink ();?> does not work for facebook comments to show on all posts. For now the only thing that works for me is to add an HTML to each post with the url of the post <div class = "fb-comments" data-href = "https: // misite / post1 /" data-width = "100%" data-numposts = "10"> </div> If anyone knows how to avoid this I would be grateful for your help. Regards. February 18, 2021 at 9:45 pm #1663980 ElvinStaff Customer Support Hi gulhio, Can you try this? <?php $current_url = home_url($_SERVER['REQUEST_URI']); echo $current_url; ?> or this <?php echo get_permalink();?> If it doesn’t work, Can you open a new topic for this? So you can use the private information text field to link us to the site in question so we could check. February 19, 2021 at 6:58 am #1664610 gulhio it worked perfectly February 21, 2021 at 6:15 pm #1667081 ElvinStaff Customer Support Nice one. glad you got it sorted. ๐ Author Posts Viewing 8 posts - 1 through 8 (of 8 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In