Adding text to the main category page

Hello - I would like to accomplish adding text to the main category page.
I am using the Ethos stack in Pro and wanted to know I would adjust this code to support this.

function add_category_description() {
if(is_category() && !is_paged()) { ?>


<div class=“x-container max width”

<?php echo category_description(); ?>


<?php
}
}
add_action( ‘x_after_view_renew__landmark-header’, ‘add_category_description’,99999 );

Reference: Add text to category page
Thank you!

Hello @ccwadsworth,

Thanks for writing to us.

You are a Pro theme user, I would suggest you create a custom layout for the category archive page there the Layout builder where you can use this {{dc:term:description}} dynamic content code to display the category description or you can simply add the custom text.

Please have a look at our documentation to learn more about how to create the custom layout for the archive page.

You may check the video tutorial as well.

Please note that the code provided in the above thread serves as a guide only and is to help you in getting started so implementing it and maintaining the code will be out of our support scope. You may contact a developer to assist you with your concerns or you can subscribe to One where customization questions are answered.

Thanks for understanding

Thank you @prakash_s, I will give that a try. Appreciate the code and the links!

Hi @ccwadsworth,

Glad to help you with this, please let us know how it works for you.

Thanks

Quick question: I was able to add the description to the specific category page.
Now I would like to add only the posts with the specific category to the page, using Layout Builder.
I have added the Dynamic Posts element but it is showing all posts, not the specific category.
I have set the condition to show the specific post category, but it is displaying all categories.


How can I display only posts with this category?
Appreciate your help, thank you!

Hello @ccwadsworth,

I would suggest you go to the Layout builder —>Post element —>Disable the Loopr Provider or Set the Looper Provider as OFF. Please note you are on the category archive page so you don’t need an extra loop since there is a default WordPress loop is running.

Hope it helps
Thanks

That did it! Thanks so much @prakash_s!

Hello @ccwadsworth,

Glad that we were able to help you.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.