Forums

string integer error (5 posts)

  1. crotalusco
    Member
    Posted 4 years ago #

    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

  2. moshu
    Member
    Posted 4 years ago #

    Errors rarely appear out of blue.
    What did you do before it started showing up? Installed new plugin(s)? Modified something?

  3. crotalusco
    Member
    Posted 4 years ago #

    updated wordpress

  4. moshu
    Member
    Posted 4 years ago #

    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?

  5. charlener
    Member
    Posted 4 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.