Support » Fixing WordPress » echo category_description(); not working since WP2.7 update

  • For some reason, after updating to WP2.7 echo category_description(); returns an error message:

    Catchable fatal error: Object of class WP_Error could not be converted to string in /<snip>/wp-content/themes/bfv/category-7.php on line 40

    This is happening for all my categories. 🙁
    Any idea why?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Might have to paste the code from that template (category-7.php) in a pastebin and report the link back here because the category_description returns the descripiton of the category if you pass a category id value or it returns the category description of the ‘current category’ if used in a ‘category page’ (is_category=true).

    heyman

    (@heyman)

    I’m having the same problem.
    MichaelH i’m not following, can you explain your text a bit more?
    Thanks
    Heyman

    Same here after 2.7 upgrade. The offending code is:

    <?php  if (strlen(category_description()) > 0)
        {
            echo "<div id='catdesc'>";
            echo category_description();
            echo "</div>";
        }
    ?>

    Any solution? Thanks

    I have the same problem!
    When i click in any category says: Fatal error: Call to undefined function: the_content_limit() in /home/oteusite/public_html/wp-content/themes/ShivaPro/shiva/archive.php on line 31

    I dont undrstand why!

    the archive.php says:

    <?php

    $theme_config = array(
    ‘featured_cat’ => 6, // Featured category ID
    );

    ?>

    have the same problem!
    When i click in any category says: Fatal error: Call to undefined function: the_content_limit() in /home/oteusite/public_html/wp-content/themes/ShivaPro/shiva/archive.php on line 31

    I dont understand why!

    the archive.php says:

    `<?php

    $theme_config = array(
    ‘featured_cat’ => 6, // Featured category ID
    );

    ?>

    I tried this and it worked <?php echo category_description($cat); ?>

    I had defined $cat as the category ID previously in this template

    <?php $cat = get_query_var('cat'); ?>

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘echo category_description(); not working since WP2.7 update’ is closed to new replies.