Site logo

Archived topic

Split category description or content below archive

2 replies · Started by Alex on February 20, 2018

Viewing posts 1–3 of 3

Hi,

What's the best way to split the category description in two, below and above the posts archive?

Since I'm using them as landing pages, I need to be able to place more content (text) for each separate category. The content needs to be different for each category.

Thanks!

Hi Alex,

You would likely need to use PHP to hook your second description in after the posts.

add_action( 'generate_after_main_content', 'tu_add_second_category_descriptions' );
function tu_add_second_category_description() {
    if ( is_category( 'Example Category' ) ) : ?>
        Some description for Example Category.
    <?php endif;

    if ( is_category( 'Another Category' ) ) : ?>
        Some description for Another Category.
    <?php endif;
}

Oops, didn't mark as resolved.

This archived topic is closed to new replies.