• amcclard

    (@amcclard)


    Hello,

    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!

    https://epic2007.com/epic_blog/

    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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Adam Brown

    (@adamrbrown)

    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.

    Thread Starter amcclard

    (@amcclard)

    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?

    Adam Brown

    (@adamrbrown)

    https://codex.www.ads-software.com/Template_Tags#Category_tags

    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.

    Thread Starter amcclard

    (@amcclard)

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

    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘category template issue’ is closed to new replies.