Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Getting current page URL when using facebook comment plugin.

Featured Replies

Hello, using facebooks comment plugin for my cms and have an error.

 

How do i set the page url to be the current page url so that all the comments etc are unique to each different product.

 

So this is what it looks like:

 

<div class="fb-comments" data-href="PAGEURL" data-width="1000" data-num-posts="20"></div> 
</div>

 

I tried using this:

 

<div class="fb-comments" data-href="<?php echo curPageURL();?>" data-width="1000" data-num-posts="20"></div> 
</div>

 

But it shows no plugin at all with that and the curPageURL functions works fine else where.

 

I also tried this:

 

My page url is e.g.

 

http://www.damnthatsgenius.com/moreinfo.php?title=$title&more=More+Info

 

so tried this:

 

<div class="fb-comments" data-href="<?php echo 'http://www.damnthatsgenius.com/moreinfo.php?title=$title&more=More+Info';?>" data-width="1000" data-num-posts="20"></div> 

 

But still no plugin showing.

 

Any ideas?

do you need the echo? and/or why not just insert the variable returned from the function?

  • Author

Using

 

<?php curPageURL();?>

 

Like that you mean? It shows the plugin, but puts it into some sort of compatibility mode :/

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.