Hi,
I am using the zenpage function printLatestNews() on the index.php page. When I goto page 2 because the album list is paginated I get this error for the latest news:
Warning: Invalid argument supplied for foreach() in F:\.......\zp-core\plugins\zenpage\zenpage-template-functions.php on line 1171
I am not sure exactly how pagination works, but it seems this function is trying to list the next x news, but the array is empty on subsequent pages. Is this a bug?
I am using 1.2.6 on a local setup so sorry i cannot provide a link....
Note: I am using the "none" option - just list news (no images)...
Comments
I call this on a custom theme, in a "sidebar" on index.php. In the main window is the album loop causing the pagination.
I put:
<?php printLatestNews( 4,'none','',true,true,150,true ); ?>
in sidebar.php in the zenpage-default theme.
On the homepage it appears fine. When I click page 2 on the home page I get the error where the latest news should appear:
Warning: Invalid argument supplied for foreach() in F:\......\zp-core\plugins\zenpage\zenpage-template-functions.php on line 1171
function getNewsArticles($articles_per_page='', $category='', $published=NULL)
It makes me think pagination is affecting it, at least for me. I will see if I can get a test site up for you to view...
A demo site would be good as everything else would be guessing.
http://www.blueskywebcreations.com/zenphoto/
Default install, activated zenpage, uploaded albums via ftp, created 3 news articles, activated zenpage-default theme, added the following to sidebar.php in zenpage-dafault:
`
<?php if(function_exists("printLatestNews")) { ?>
<?php echo gettext("Latest News"); ?>
<?php printLatestNews( 4,'none','',true,true,150,true ); ?><?php } ?>
`