robertsmith17
-
Posts
2 -
Joined
-
Last visited
Posts posted by robertsmith17
-
-
I'm a complete newbie with PHP - have been making some changes on a WordPress site and ran across an error "Warning: Invalid argument supplied for foreach() in /home/thesite/public_html/wp-content/themes/site1/custompost_entertainment.php on line 35"
if ($post->post_type == 'page'){ echo apply_filters('the_content',$post->post_content); echo "<section id='featured_pages'>"; foreach ($customPosts as $date=>$posts){ $date = new DateTime($date); foreach ($posts as $page){ $custom_meta = get_post_custom($page->ID);
Any ideas?
Simple help for broken PHP
in PHP Coding Help
Posted
Thanks for the replies, I really appreciate it.
I don't really understand the syntax of
Like I said - I'm a complete novice with PHP.
I'm a lot more comfortable with the likes of C#, where a foreach loop would be written something like this (for example):
I'm afraid I just don't understand "$customPosts as $date=>$posts" at all. Could someone pseudo-code it for me? Or explain it in terms of C#/Java/JS type syntax?
Thanks again. Sorry for being a bit dense...