- This topic has 5 replies, 2 voices, and was last updated 4 years, 11 months ago by
David.
-
AuthorPosts
-
November 20, 2020 at 5:04 pm #1539564
Ayoosh
I am working on customizing few options on my site and like to customize the category page to show the posts and numbered lists ( I don’t have any image and other stuff), here is how I might want to display the data on category page.
https://pasteboard.co/JBjPmQG.pngHow can I do that without impacting any other page
November 21, 2020 at 4:26 am #1539833David
StaffCustomer SupportHi there,
you would need to use the
option_generate_blog_settingsfilter to disable the elements you don’t require:https://docs.generatepress.com/article/option_generate_blog_settings/
Heres an example PHP Snippet that disables some elements on the category archives:
add_filter( 'option_generate_blog_settings', 'db_custom_category_archive' ); function db_custom_category_archive( $options ) { if ( is_category() ) { $options['read_more_button'] = false; $options['date'] = false; $options['categories'] = false; $options['tags'] = false; $options['post_image'] = false; $options['column_layout'] = false; $options['featured_column'] = false; $options['masonry'] = false; } return $options; }November 21, 2020 at 8:00 am #1540185Ayoosh
Thanks for your response David, I do have following questions
1. With this hook , I am still seeing the excerpt in the category page. I am assuming this is because of the standard WordPress if we manually adding excerpt to our posts.
2. I still don’t see this as an ordered list, is there a way I can work on the CSS using premium options? Current category page layout have too much space and all I need is a ordered list.
Note: I have removed the excerpt using the standard WP hook
You can check layout at https://staging.javadevjournal.com/category/spring-security/
Thanks
AyooshNovember 21, 2020 at 8:15 am #1540193David
StaffCustomer SupportSo first off to remove the Excerpt, apply the PHP Snippet provided here:
https://docs.generatepress.com/article/excerpt_length/
Then add this CSS to display the Counter:
.archive.category .site-main { counter-reset: section; } .archive.category .site-main article h2:before { counter-increment: section; content: counter(section) '. '; } .archive.category .entry-summary, .archive.category .entry-meta { display: none; } /*** Optional ***/ /* remove padding from article */ .archive.category .site-main article .inside-article { padding-top: 0; padding-bottom: 0; } /* Change the font size */ .archive.category .site-main article h2 { font-size: 24px; }I have included some optional CSS to style the article and post title if you need to.
November 21, 2020 at 9:03 am #1540228Ayoosh
Hey David,
Thanks for your quick and wonderful response, I am able to fix most of the issue and layout is very close to what I was thinking 🙂
November 22, 2020 at 4:55 am #1540854David
StaffCustomer SupportThats great! – Glad to be of help
-
AuthorPosts
- You must be logged in to reply to this topic.