category template issue (6 posts)

  1. amcclard
    Posted 7 years ago #


    I had Word Press installed and it seemed to be working okay until I added a new theme today. I use this theme on a different site without any problems, but on an older version of WordPress. Anyway, I am hoping that someone will be able to help be remedy this issue. Below is the warning that I am getting, and you can see it yourself in action!


    Warning: array_key_exists(): The first argument should be either a string or an integer in /home/content/K/e/n/KenAnderson/html/epic_blog/wp-includes/category-template.php on line 176

  2. Adam Brown
    Posted 7 years ago #

    If you take a look at the template tags, you'll see that several of the category tags are now marked as "deprecated." Look in your theme for any of those tags and remove them (or replace with a non-deprecated tag).

    Or contact the theme author to see if there is a 2.3 compatible version of the theme.

  3. amcclard
    Posted 7 years ago #

    Thanks for your reply. The link for template tags does not work for some reason. Where do I look for these "deprecated tags," and how do I go about removing them?

  4. Adam Brown
    Posted 7 years ago #


    There's the link again.

    They might be all over the theme. Most likely in index.php and single.php. You may want to start by seeing whether the theme author has updated the theme already, if you haven't already checked.

  5. amcclard
    Posted 7 years ago #

    I did check, but was unsuccessful. His site hasn't been updated in a year. Maybe he has it posted someplace else.

  6. stjasink
    Posted 7 years ago #

    If there is no upgrade for your theme available and are feeling brave, you can edit your category-template.php file to check for the categories explicitly.

    replace this line (line 176):
    if(array_key_exists($category, $categories))

    with this:
    if(!(false === $category) && array_key_exists($category, $categories))

    I have been having this error and have put a quick post about it here.

Topic Closed

This topic has been closed to new replies.

About this Topic