Member
Member
undagiga   2017-10-16, 06:28
#1
I'm working with seroxatmad's Facebook Like plugin. I had to edit to remove some white space that was causing "Cannot modify header information - headers already sent" errors. I then used it to create a FB comments plugin. I am showing the like button in the header and the comment block in the footer. But I only want them to appear on album and image pages, and not on things like the contact form. I constructed a code snippet based on other pages, and inserted it into inc_footer.php and inc_header.php:

<?php if (function_exists('printFBComments')) { ?>
<?php if (isAlbumPage() or isImagePage) { ?>
<?php printFBComments(); ?>
<?php } ?>
<?php } ?>

but despite this, I get the comments block on all pages. I take I'm doing something wrong.
Administrator
Administrator
acrylian   2017-10-16, 07:59
#2
`isAlbumPage()` or `isImagePage` are the wrong functions to use. They check if this is an album page with images and/or subalbums.

You can use the global variable `$_zp_gallery_page` which would be `album.php`or `image.php` if you are on the related theme page.

That is if the theme used uses the standard theme setup.
Member
Member
undagiga   2017-10-16, 11:20
#3
Thanks. Is that still going to work even if the call is from the header and footer?
Administrator
Administrator
acrylian   2017-10-16, 12:55
#4
Yes
Member
Member
undagiga   2017-10-16, 23:06
#5
Thanks again.
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.