Skip to content

Instantly share code, notes, and snippets.

@tdmrhn
Created March 10, 2024 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdmrhn/dfd170808292a7e8175bbc7faa3684b2 to your computer and use it in GitHub Desktop.
Save tdmrhn/dfd170808292a7e8175bbc7faa3684b2 to your computer and use it in GitHub Desktop.
Blocksy 2: Easy Bento Grid for Archives with Customizer Grid Type
.entries[data-layout="grid"] article:first-child,
.entries[data-layout="grid"] article:nth-child(8n),
.entries[data-layout="grid"] article:nth-child(23n),
.entries[data-layout="grid"] article:nth-child(79n),
.entries[data-layout="grid"] article:nth-child(91n) {
grid-column: span 2;
}
.entries[data-layout="grid"] article:first-child,
.entries[data-layout="grid"] article:nth-child(7n),
.entries[data-layout="grid"] article:nth-child(45n),
.entries[data-layout="grid"] article:nth-child(94n) {
grid-row: span 2;
}
@tdmrhn
Copy link
Author

tdmrhn commented Mar 10, 2024

/* use this code for custom post type archive */
/* change "projects" with you own CPT slug */
[data-prefix="projects_archive"] .entries[data-layout="grid"] article:first-child,
[data-prefix="projects_archive"] .entries[data-layout="grid"] article:nth-child(8n),
[data-prefix="projects_archive"] .entries[data-layout="grid"] article:nth-child(23n),
[data-prefix="projects_archive"] .entries[data-layout="grid"] article:nth-child(79n),
[data-prefix="projects_archive"] .entries[data-layout="grid"] article:nth-child(91n) { 
grid-column: span 2; 
}
[data-prefix="projects_archive"] .entries[data-layout="grid"] article:first-child,
[data-prefix="projects_archive"] .entries[data-layout="grid"] article:nth-child(7n),
[data-prefix="projects_archive"] .entries[data-layout="grid"] article:nth-child(45n),
[data-prefix="projects_archive"] .entries[data-layout="grid"] article:nth-child(94n) { 
grid-row: span 2; 
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment