Black Friday Sale! Get up to $40 off GP Premium!Learn more

[Resolved] Split category description or content below archive

Home Forums Support Split category description or content below archive

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #501248
    Alex

    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!

    #501622
    Tom
    Lead Developer
    Lead Developer

    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;
    }
    #1304546
    Alex

    Oops, didn’t mark as resolved.

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