WordPress.org

Ready to get started?Download WordPress

Forums

echo category_description(); not working since WP2.7 update (7 posts)

  1. saxsux
    Member
    Posted 5 years ago #

    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?

  2. MichaelH
    Member
    Posted 5 years ago #

    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).

  3. heyman
    Member
    Posted 5 years ago #

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

  4. David Radovanovic
    Member
    Posted 5 years ago #

    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

  5. rikardo_porto
    Member
    Posted 5 years ago #

    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
    );

    ?>

  6. rikardo_porto
    Member
    Posted 5 years ago #

    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
    );

    ?>

  7. kulpreetsingh
    Member
    Posted 4 years ago #

    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'); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic