• Anonymous

    I had posted a few test posts and on my blog page only this was there:
    Warning: Invalid argument supplied for foreach() in D:\Apache\Apache2\htdocs\rebel\wordpress-1.0.1-miles\wp.php on line 21
    How can I fix this?
    Thanks ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Anonymous

    Never mind… problem fixed. ??

    I have just upgraded my wp this morning and have tried to modify my index.php file…
    Now I get this errorWarning: Invalid argument supplied for foreach() in /customers/deep-within.dk/deep-within.dk/httpd.www/index.php on line 8
    Line 8 in my index is this:
    <?php foreach ($posts as $post) { start_wp(); ?>
    My entire index looks like this:
    <?php include(“header.php”) ?>
    <?php /* Don’t remove this line, it calls the WP function files ! */
    $blog=1;
    require_once(“wp-blog-header.php”);
    ?><meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
    <!– // loop start –>
    <?php foreach ($posts as $post) { start_wp(); ?>
    <?php the_date(“d.m.y”,”<b>”,”</b>”); ?>
    <?php the_content(); ?><?php link_pages(“
    Pages: “,”
    “,”number”) ?>
    posted by <?php the_author() ?> @ “><?php the_time() ?>
    <?php comments_popup_link(“comments ?”, “1 comment”, “% comments”) ?>
    <?php include (“wp-comments.php”); ?>
    <?php } ?>
    <? include(“footer.php”) ?>
    Have I edited out too much code???:

    Dont worry.. Ive found the error..
    ive put the include for the header before the wp-blog.header code…
    It should be after…

    Why can’t wordpress run with the include(“header.php”) BEFORE the wp-blog.header code??
    The way it is now, it doesnt make the site able to be validated.. Simply because it has to have the header include as the first code to pick up to find my html/xhtml code….
    Is there someway that can be fixed so it can be validated??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘What is this error??’ is closed to new replies.