Archived topic
custom hook
3 replies · Started by Anil on February 7, 2022
Hi
I need to display some text after category description in category page if category description available.
Thanks in advance.
Hi Anil,
You can create a new hook element, add this code to the content area:
<?php
$term_description = get_the_archive_description();
if ( ! empty( $term_description ) ) {
echo '<div> some text </div>';
}
return '';
?>
Replace <div> some text </div> with your own content.
Make sure the Execute PHP box is checked, set category archive as the location, and choose generate_after_archive_description as the hook.
Please refer to the screenshot below:
https://www.screencast.com/t/lYQZWbLr
Thankyou very much Ying, it is working fine.
Regards.
You are welcome :)