Getting error on localhost (xampp), but not online — problem with the loop
-
I’m having a problem, if you look at https://wphax.com you’ll see that there’s no PHP errors. On localhost (using xampp for a server), I am getting the following error:
Warning: in_array() expects parameter 2 to be array, null given in C:\xampp\htdocs\wordpress\wp-content\themes\wphax\index.php on line 124
And here is the loop that is apparently having the problem:
<?php $tempo_query = new WP_Query('category_name=blog&posts_per_page=1'); while ($tempo_query->have_posts()) : $tempo_query->the_post(); if (in_array($post->ID, $do_not_duplicate)) continue; ?>
My first loop looks like this, so
$do_not_duplicate
should be an array…<?php $my_query = new WP_Query('category_name=portfolio&posts_per_page=2&offset=2'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate[] = $post->ID; ?>
Can anybody tell me what’s going on?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Getting error on localhost (xampp), but not online — problem with the loop’ is closed to new replies.