[Support request] What is the Permalink PHP code on Generate Press theme?

Home Forums Support [Support request] What is the Permalink PHP code on Generate Press theme?

Home Forums Support What is the Permalink PHP code on Generate Press theme?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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.

    #1626806
    Tom
    Lead 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 ๐Ÿ™‚

    #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)

    #1628171
    Tom
    Lead Developer
    Lead Developer

    Are there any instructions for what you’re trying to do? Do they suggest using the_permalink()?

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

    #1663980
    Elvin
    Staff
    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.

    A wise man once said:
    "Have you cleared your cache?"

    #1664610
    gulhio

    it worked perfectly

    #1667081
    Elvin
    Staff
    Customer Support

    Nice one. glad you got it sorted. ๐Ÿ˜€

    A wise man once said:
    "Have you cleared your cache?"

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.