[Resolved] Category description after posts

Home Forums Support [Resolved] Category description after posts

Home Forums Support Category description after posts

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #443837
    Florian

    Hi,

    Is it possible to show the WP category description on the categories after the posts? I want to have longer category descriptions below the fold.

    Screenshot

    Thanks,
    Florian

    #444312
    Tom
    Lead Developer
    Lead Developer

    Hmm, not easily, but do-able.

    First, hide the current description:

    .page-header .taxonomy-description {
        display: none;
    }

    Then add it in:

    add_action( 'generate_after_main_content', 'tu_tax_description_after_content' );
    function tu_tax_description_after_content() {
        if ( ! is_archive() ) {
            return;
        }
    
        $term_description = term_description();
        if ( ! empty( $term_description ) ) {
            printf( '<div class="taxonomy-description">%s</div>', $term_description );
        }
    }

    You’ll likely have to style it with some CSS, but that should get you started πŸ™‚

    #444717
    Florian

    That works πŸ™‚ Thanks for your help!

    #444910
    Tom
    Lead Developer
    Lead Developer

    You’re welcome πŸ™‚

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.