Support » Requests and Feedback » Update to Codex loop page

  • wmmead


    Hello, I have an update to the codex page on the loop. I am not sure I am putting this comment in the correct location. Please let me know if I should be putting it elsewhere.

    I have multiple loops running on a magazine style site and do not want duplicate posts from one column to the next. I followed the procedure found on the codex, which was working, but I was getting an error in my error log telling me that the data type for the second argument in the is_array() function was not the correct type.

    Upon looking up the function on the site, I modified the use of the function in the loop like this:

    if ( in_array( $post->ID, $do_not_duplicate, true ) ) continue;?>

    I added the word “true”. This keeps the errors from being generated in the error log. I think this is fairly new to PHP and should, I am guessing be added to the codex page. The code was working without it, but it was generating the error. I don’t think a lot of people check their error log file so they probably have no idea.

    I hope this helps someone, and let me know if I should be posting this info somewhere else.

Viewing 1 replies (of 1 total)
  • well, if you have an edit for the codex, you should be posting it there! The codex is community driven

Viewing 1 replies (of 1 total)
  • The topic ‘Update to Codex loop page’ is closed to new replies.