upgraded to wp and this code in the loop is returning errors
-
hi
i have this code in the loop that reads the tags in a post and if it finds one in particular “Peace initiatives” it then changes the div class and the border goes grey.<?php $post_class="post"; $tags=get_the_tags($id); foreach ($tags as $key => $post_type) { $tag_str=$post_type->name; if (stripos($tag_str,'Peace initiatives')) { $tag_str="Peace initiatives"; } switch ($tag_str) { case 'Peace initiatives': $post_class="post-peace"; break; } } ?>
after upgrading i get a crazy error sometimes, not everytime that says:
Warning: Invalid argument supplied for foreach() in /…/wp-content/themes/pact-by-cezar/index.php on line 31
the line is the foreach line i use above. have the $tags arguments changed in wp 2.5?
can anyone help me out? the blog is here: https://www.pact.lk
thanksC
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘upgraded to wp and this code in the loop is returning errors’ is closed to new replies.