Fatal error when trying to list categories (3 posts)

  1. _ardnas
    Posted 10 years ago #

    I'm trying to list certain categories in a file I named categories.php, but each time I refresh I get

    Fatal error: Call to undefined function: wp_list_cats() in /home/sites/daisymedia.net/public_html/movies/categories.php on line 10

    I don't understand what I'm doing wrong. Help, anyone? Here's the coding for categories.php

    <? include('header.php'); ?>

    <div class=storycontent>
    <h3>The reviews</h3>

    Below are listed the movies reviewed so far. All movies have been set as categories, and may contain several reviews, each by another reviewer.

      <?php wp_list_cats('sort_column=name&optioncount=1&exclude=1, 17'); ?>

    <? include('footer.php'); ?>

    Any help appreciated!

  2. Kafkaesqui

    Posted 10 years ago #

    You might try re-uploading template-functions-category.php (in the wp-includes/ directory). This is the script which holds the wp_list_cats() function, and possible it's corrupted or incomplete.

    EDIT: Read over your post again and it appears this is for a PHP document which is not part of the standard WP theme template hierarchy. To use a WordPress function in PHP scripts which reside outside WordPress, you need to include the wp-blog-header.php file, found in your blog's root directory.

  3. _ardnas
    Posted 10 years ago #

    Ahh, thank you so much! :D Your solution worked like a charm.

Topic Closed

This topic has been closed to new replies.

About this Topic