- This topic has 7 replies, 4 voices, and was last updated 2 years, 6 months ago by
David.
-
AuthorPosts
-
October 12, 2022 at 9:27 am #2371332
Torsten
Hi,
I have 2 questions:
1.
I would like to display the category pages without the category name above the posts..page-header .author-info>:last-child, .page-header>:last-child { display: none; }
leaves the white body background colour…
check out “News” and Link in “Private Information”, white space between header and posts.
2.
I would like to have space between the posts on the category pages, and only there, not on the start page. How can the code below be set for category pages only?.generate-columns { margin-bottom: 20px; padding-left: 20px; }
Can you help?
Thanks ahead,
TorstenOctober 12, 2022 at 10:36 am #2371391Ying
StaffCustomer SupportHi Torsten,
1. You can use this snippet to remove the
page-header
for category archives:add_action('wp', function() { if (is_category() ) { remove_action( 'generate_archive_title', 'generate_archive_title' ); } });
Adding PHP: https://docs.generatepress.com/article/adding-php/
2. Your CSS can be modified to this:
.archive.category .generate-columns { margin-bottom: 20px; padding-left: 20px; }
October 13, 2022 at 12:25 am #2371932Torsten
Hi Ying,
thanks for #1, working fine.
For #2, unfortunately this code doesn’t give me the 20px space in background colour #EBE7E0 between the posts on the pages mentioned in “Private information”.
Please check again, I left your Code in Custom CSS.
best,
TorstenOctober 13, 2022 at 12:58 am #2371967Fernando Customer Support
Hi Torsten,
For reference, can you take a screenshot of the specific location you which to add spacing to? The code provided by Ying seems to work from my end for adding space between posts.
Uploading Screenshots: https://docs.generatepress.com/article/using-the-premium-support-forum/#uploading-screenshots
October 13, 2022 at 2:37 am #2372070Torsten
Hi Fernando,
find 2 image links in Private information as well as both URLs to the category pages.
Image one (Kuenstlerinnen) shows on the left part the actual state, the right one shows the space in background colour between the posts as wanted.The effect is the same as setting “Customizer / Layout / Container / seperate Container”, shown in the 2nd image which shows the homepage with this setting and the then unwanted spacings, highlighted in light green and with arrows.
I excluded the unimportant middle part of the screenshot (pixeled).Hope that helps,
best,
TorstenOctober 13, 2022 at 3:54 am #2372128David
StaffCustomer SupportHi there,
if you have the site Customizer > Layout > Container set to One Container.
Then you can use this PHP Snippet to set the the Container to Separate Containers for specific template tags eg.add_filter( 'option_generate_settings','lh_single_posts_settings' ); function lh_single_posts_settings( $options ) { if ( !is_single() ) { $options['content_layout_setting'] = 'separate-containers'; } return $options; }
That will set any NON single template ( eg. blog, archives, homepage ) to separate containers.
October 13, 2022 at 4:16 am #2372152Torsten
Hi David,
still not what I wanted to achieve, but with Yings code as a starting point I’ve now set a box shadow, which works fine for me..archive.category .generate-columns { padding: 20px; box-shadow: 0 8px 8px 0 #ebe7e0; }
Thanks to Ying, Fernando and David,
best,
TorstenOctober 13, 2022 at 4:32 am #2372162David
StaffCustomer SupportGlad to hear you found a solution
-
AuthorPosts
- You must be logged in to reply to this topic.