• Hi,

    new to wordpress and having a problem with my site.
    In the field where I suppose should show earlier posts it gives me error:

    Warning: Invalid argument supplied for foreach() in /customers/4/1/4/jackpottguiden.se/httpd.www/wp-content/themes/nobeliumful/front-page.php on line 9

    Code below!
    THANKS!

    <?php get_header(); ?>
    
    <div id="primary">
    	<div id="content" role="main">
    
    	<?php
    		$cats = Padd_Option::get('featured_categories', array('1', '2', '3', '4'));
    		$i = 1;
    		foreach ($cats as $cat) {
    			padd_featured_categories_items($cat,$i);
    			if (2 == $i) :
    				$i = 0;
    				?>
    				<div class="clear"></div>
    		<?php
    			endif;
    			$i++;
    		}
    	?>
    		<div class="clear"></div>
    
    	</div><!-- #content -->
    </div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • It would seem that $cats is not an array or an object – so you cannot run a foreach loop on it.

    Thread Starter Qreizt

    (@qreizt)

    ok strange, I downloaded the theme as it is without any changes.

    Then I can only suggest that the theme is broken. Sorry – there’s just not enough to work off and the theme appears to be using some of its own custom functionality/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Warning: Invalid argument supplied for foreach()’ is closed to new replies.