WordPress.org

Ready to get started?Download WordPress

Forums

category template issue (6 posts)

  1. amcclard
    Member
    Posted 6 years ago #

    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!

    http://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

  2. Adam Brown
    Member
    Posted 6 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
    Member
    Posted 6 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
    Member
    Posted 6 years ago #

    http://codex.wordpress.org/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.

  5. amcclard
    Member
    Posted 6 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
    Member
    Posted 6 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