Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #777261

    hi, normally i use this code to show the category description only on the first page:

    <?php if (!is_paged()) {?>
    <div class=”category-term-description”><?php echo category_description( $category_id ); ?></div>
    <?php }?>

    but in enfold i get this debug message

    Notice: Undefined variable: category_id in /var/www/……………./archive.php on line 33

    is it possible to modify your standard code in the archive.php

    <?php

    $tds = term_description();
    if($tds)
    {
    echo “<div class=’category-term-description’>{$tds}</div>”;
    }
    ?>

    that shows the category description only on the first page?

    thank you

    #777919

    Hey siteraum,

    Do you still need help with this issue? I don’t see the category description on the second page.

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #778149

    Hi Victoria,
    you cant see the description on the page becauce i use this

    <?php if (!is_paged()) {?>
    <div class=”category-term-description”><?php echo category_description( $category_id ); ?></div>
    <?php }?>

    but know i change it back to the standard enfold code in the archive.php.

    Can you please look again, and how can i disable the description on the second page of the categorie (without using display:none; !)

    thank you victoria

    #778164

    Hi,

    Try to add this code before the if is_paged

    $categories = get_the_category();
    $category_id = $categories[0]->cat_ID;
    

    Best regards,
    John Torvik

    #778173

    hi john,

    thank´s a lot- now no debug message!. it works perfect.

    thank you
    john

    #778263

    Hi!

    Happy we can help.
    Please feel free to let us know if there is anything else we can do to help you out.

    Thank you

    Cheers!
    Basilis

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘How to display category description only on the first page’ is closed to new replies.