Archived topic
Category View "Nothing Found" display description and title
5 replies · Started by JC on March 20, 2021
Hello,
I have a lot of empty categories on a new build and notice that, when there are no posts in it, the title and description of the category does not display. The one category with posts displays fine.
How do I make sure title and category description displays even if the category is empty.
Thank you in advance.
I too would like the category description to display even if there are no posts in that category.
Any luck on this one? I'd like the archive title and description and my Hooks to show up even if there are no posts too.
By default, the theme uses /no-results.php template if there's no post under the category.
Are you trying to display both the archive title and the "Nothing Found"?
I think everyone here wants at least the archive title and description (and associated Element Hooks) to be displayed rather than the Nothing Found.
You may have create a child theme and have a copy of the child theme's archive.php.
You then modify this part of the condition to not do generate_do_template_part( 'none' ); and keep usinggenerate_do_template_part( 'archive' );https://github.com/tomusborne/generatepress/blob/adfe090929b0515cdf894f4c6b722cfe8c0790dc/archive.php#L24
David explains it further here - https://generatepress.com/forums/topic/nothing-found-page-2/#post-1532349
Alternatively, you can go w/ the no-results.php template route w/ Tom's suggestion here -
https://generatepress.com/forums/topic/how-can-i-customize-the-nothing-found-layout-on-archive-php-with-elements/#post-738664