Support Forums for LiveMesh Themes & Plugins › Forums › Peak Theme Support › How to show category description
- This topic has 4 replies, 2 voices, and was last updated 7 years, 7 months ago by Raghavendra.
-
AuthorPosts
-
September 21, 2016 at 1:41 pm #24178stoyanoffMember
Hi there,
We are using your theme to setup a custom site for the client. As always client comes each time with something new in mind and sometimes it is difficult for us to do it.We are not so skillful with theming for wordpress (that’s why we bought a ready made theme) and we need to show category description in category list. We create several categories and subcategories and client wants to show a description for some of the categories instead of list with published articles. We’ve checked theme files, but as it is custom made framework, we are not feeling sure that we can make it.
Can you please provide help what to be included and in which files in the theme.
We need to show category description if any instead of article list and if no description, then show article list.
I hope that explain it well 🙂Thank you in advance.
September 22, 2016 at 1:22 pm #24196RaghavendraModeratorI am not clear on where you want the category description to be shown. Can you pls provide a screenshot of a page which has the category information and where your client would like to see the category description? Need this info to provide the right code to make this happen. Thanks.
September 22, 2016 at 1:48 pm #24197stoyanoffMemberWell,
If we create couple of categories and posts in them, when we browse a category, we see list of posts in this category. My client wants to use categories and subcategories and in some of the categories there will be no posts and instead of result “No posts were found with the criteria specified. Try searching again.”, client wants to show category description – check attached screenshot. Now description is shown in category header with category title.Hope this time is clear 🙂
Thanks in advance again.
September 24, 2016 at 4:20 am #24230RaghavendraModeratorPls replace the current content of the loop-error.php file to match your custom requirement –
<?php /** * Loop Error Template * * Displays an error message when no posts are found. * * @package Peak * @subpackage Template */ ?> <div id="post-0" <?php post_class(); ?>> <div class="entry-content clearfix"> <?php if (is_category()) : ?> <div class="loop-meta"> <div class="loop-description"> <?php echo category_description(); ?> </div> <!-- .loop-description --> </div><!-- .loop-meta --> <?php else: ?> <p><?php esc_html_e('No posts were found with the criteria specified. Try searching again.', 'peak'); ?></p> <?php get_search_form(); // Loads the searchform.php template. ?> <?php endif; ?> </div><!-- .entry-content --> </div><!-- .hentry .error -->
You will need to remove the category description from the loop-meta.php file if you do not need it there at line number 39.
September 24, 2016 at 4:21 am #24231RaghavendraModeratorBTW, you can make these changes in the child theme without disturbing the parent theme by having files with the same name in child theme.
-
AuthorPosts
- The forum ‘Peak Theme Support’ is closed to new topics and replies.