ZenphotoCMS Forum
Problems integrating wordpress and zenphoto - Cannot modify header information.. - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Problems integrating wordpress and zenphoto - Cannot modify header information.. (/thread-5543.html)



Problems integrating wordpress and zenphoto - Cannot modify header information.. - marc - 2009-07-27

I recently upgraded zenphoto from 1.0.6 to the nightly 1.2.5 from last night - 7.25.2009.
I had zenphoto working fine integrated into my wordpress site with the K2reloaded theme. However now reworking the upgraded zenphoto back into wordpress I get a bunch of warnings (see below).

I'm stuck. Any ideas? I read through all the posts on a similar topic and followed the guide to integrate zenphoto into wordpress.

This is what my index.php file looks like...
require_once(dirname(FILE).'/zp-core/folder-definitions.php');
...
require_once(ZENFOLDER . "/template-functions.php");
...

/ Start Wordpress /
define('WP_USE_THEMES', false);
require('../wp-blog-header.php');
get_header();

require_once(dirname(FILE). "/".ZENFOLDER.'/controller.php');

header ('Content-Type: text/html; charset=' . getOption('charset'));
$obj = '';
...
rest of the guts of main zenphoto index.php stuff
....
get_footer();

WARNINGS:
Warning: Cannot modify header information - headers already sent by (output started at /home4/vvrozcom/public_html/wp-content/themes/K2reloaded/header.php:6) in /home4/vvrozcom/public_html/photos/index.php on line 46

Warning: Cannot modify header information - headers already sent by (output started at /home4/vvrozcom/public_html/wp-content/themes/K2reloaded/header.php:6) in /home4/vvrozcom/public_html/photos/zp-core/functions.php on line 1796

Warning: Cannot modify header information - headers already sent by (output started at /home4/vvrozcom/public_html/wp-content/themes/K2reloaded/header.php:6) in /home4/vvrozcom/public_html/photos/index.php on line 156

Warning: Cannot modify header information - headers already sent by (output started at /home4/vvrozcom/public_html/wp-content/themes/K2reloaded/header.php:6) in /home4/vvrozcom/public_html/photos/index.php on line 157

Warning: Cannot modify header information - headers already sent by (output started at /home4/vvrozcom/public_html/wp-content/themes/K2reloaded/header.php:6) in /home4/vvrozcom/public_html/photos/index.php on line 158




Problems integrating wordpress and zenphoto - Cannot modify header information.. - marc - 2009-07-27

I ended up moving the wordpress get_header(); call into my theme's index,album,image.php files instead of having it called from the main zenphoto index.php file, and that seemed to help. Not sure if there is a more straight forward way so that you don't have to reproduce the wordpress call for each theme file.

If anyone has a better solution, I'd love to hear it.




Problems integrating wordpress and zenphoto - Cannot modify header information.. - acrylian - 2009-07-27

That is bascially what we do on Zenphoto.org, too except that we use a additional header.php file (called before anything else) that looks like this:
`




Problems integrating wordpress and zenphoto - Cannot modify header information.. - Mnemon - 2009-11-01

Hi,

I know this isn't supported, but if someone out there could provide me with an a bit more detailed step-by-step guide on how to fix this I'd be quite thankful .

I'd used to have it running using Ruzee's old guide, creating a separate theme in ZenPhoto press, and then modifying index.php/album.php/image.php within that theme subfolder.

I get a heap of errors on my gallery page, since upgrading to 1.2.x before the actual gallery is being displayed: http://www.confession-box.org/gallery/

Thanks in advance,
-Mnemon




Problems integrating wordpress and zenphoto - Cannot modify header information.. - acrylian - 2009-11-01

The "Function ereg() is deprecated" is fixed in the nighty build (and its not really an error), about the other ones I don't know right now as we don't know what exactly you are doing for inclusion. Mabye post some code.




Problems integrating wordpress and zenphoto - Cannot modify header information.. - Mnemon - 2009-11-01

Hi,

thanks for the quick reply Will wait for next stable release. Regarding the rest, my index/album/image.php in theme folder all look like this:

[zenphoto stuff here - i.e. everything included in div="main"]

Cheers,
-Mnemon




Problems integrating wordpress and zenphoto - Cannot modify header information.. - acrylian - 2009-11-01

Here is the head section (excluded in a header.php file actually) of our Zenphoto theme on zenphoto.org that we haven't changed since 2007:
`