• I am receiving this error

    Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/dhs303/public_html/wp-includes/category-template.php on line 176

    Here is the code.

    $categories = get_object_term_cache($post->ID, ‘category’);
    if ( false === $categories )
    $categories = wp_get_object_terms($post->ID, ‘category’);
    if(array_key_exists($category, $categories))
    return true;
    else
    return false;

    Can anyone tell me what the problem is

Viewing 4 replies - 1 through 4 (of 4 total)
  • Errors rarely appear out of blue.
    What did you do before it started showing up? Installed new plugin(s)? Modified something?

    Thread Starter crotalusco

    (@crotalusco)

    updated wordpress

    You mean you upgraded from an earlier version? Which one… ALways give details if you want quick help!
    Is that theme compatible with the lates WP?
    Does the error persist if you switch to the latest default or classic theme?

    I get the same problem and googling the error gives you many many blogs with the same error.

    I went from 3.1.x to latest version (3.2.6?) and warning does not appear with the default theme.

    Was there some change in how themes are coded since that older version? For a *real* fix I’d like to change the source code but for quick and dirty I may just suppress the error.

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