Skip to content

Instantly share code, notes, and snippets.

@thegulshankumar
Created December 31, 2024 09:12
Show Gist options
  • Save thegulshankumar/940d948215da38bf8ef1c2d3761afe9f to your computer and use it in GitHub Desktop.
Save thegulshankumar/940d948215da38bf8ef1c2d3761afe9f to your computer and use it in GitHub Desktop.
A better style for the Web Stories archive
<style>
.separate-containers .page-header {
border: none;
margin-left: 15px;
}
/* Main container styles */
.post-type-archive-web-story .site-main {
display: flex;
flex-wrap: wrap;
justify-content: center; /* Centers the stories */
gap: 20px;
padding: 20px;
}
/* Web story item styles */
.site-main .web-story {
flex: 0 0 calc(33.33% - 20px);
max-width: calc(33.33% - 20px);
display: flex;
flex-direction: column;
align-items: center; /* Center align content */
margin-bottom: 20px;
text-align: center; /* Center text */
}
/* Image container */
.web-story .post-image {
order: 1; /* Place image first */
width: 100%;
}
.web-story .post-image img {
width: 100%;
height: auto;
object-fit: cover;
}
/* Title styles */
.web-story .entry-header {
order: 2; /* Place title below the image */
margin-top: 10px;
}
.web-story .entry-header h2 {
font-size: 16px;
line-height: 1.3;
margin: 0;
}
/* Hide summary */
.entry-summary {
display: none;
}
/* Load more button styles */
.masonry-load-more {
flex: 0 0 100%;
text-align: center;
margin-top: 20px;
order: 999;
}
.masonry-load-more .button {
max-width: 114px;
display: inline-block;
text-align: center;
}
/* Responsive styles */
@media (max-width: 1024px) {
.site-main .web-story {
flex: 0 0 calc(50% - 10px);
max-width: calc(50% - 10px);
}
}
@media (max-width: 767px) {
.site-main .web-story {
flex: 0 0 100%;
max-width: 100%;
}
}
/* Optional: Hover effect for web stories */
.web-story:hover {
transform: translateY(-2px);
transition: transform 0.2s ease;
}
/* Page header styles */
.post-type-archive-web-story .page-header {
flex: 0 0 100%;
margin-bottom: 20px;
}
/* Navigation styles */
.paging-navigation {
flex: 0 0 100%;
text-align: center;
margin-top: 20px;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment