{"id":36331139,"url":"https://github.com/lambry/bloc","last_synced_at":"2026-01-11T12:00:04.225Z","repository":{"id":62550237,"uuid":"429329891","full_name":"lambry/bloc","owner":"lambry","description":"A few useful WordPress blocks and block options.","archived":false,"fork":false,"pushed_at":"2022-10-23T00:10:47.000Z","size":1523,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T05:33:52.216Z","etag":null,"topics":["plugin","wordpress"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lambry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-18T07:06:12.000Z","updated_at":"2022-05-29T06:23:32.000Z","dependencies_parsed_at":"2022-11-03T02:00:26.746Z","dependency_job_id":null,"html_url":"https://github.com/lambry/bloc","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/lambry/bloc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambry%2Fbloc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambry%2Fbloc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambry%2Fbloc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambry%2Fbloc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lambry","download_url":"https://codeload.github.com/lambry/bloc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambry%2Fbloc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28301953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T11:18:18.743Z","status":"ssl_error","status_checked_at":"2026-01-11T11:07:56.842Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["plugin","wordpress"],"created_at":"2026-01-11T12:00:03.582Z","updated_at":"2026-01-11T12:00:04.219Z","avatar_url":"https://github.com/lambry.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bloc\n\nA few useful WordPress blocks and block options.\n\n`composer require lambry/bloc`\n\n## Options\n\nExtensions to core blocks for a little extra functionality.\n\n### Features\n\n- Shift: Choose to shift the block up or down.\n- Padding: Add padding to any and all sides of a block.\n- Max width: Limit the block to maximum width.\n- Animate in: Fade in a block when it's scrolled into view.\n- Retrict to: Only show blocks for certain user roles.\n- Visibility: Hide blocks for certain screen sizes.\n\n![options](images/options.jpg)\n\n### Custom properties\n\n```css\n:root {\n\t--bloc-shift-up: -5rem;\n\t--bloc-shift-down: -5rem;\n\t--bloc-padding-sm: 1rem;\n\t--bloc-padding-md: 2.5rem;\n\t--bloc-padding-lg: 5rem;\n\t--bloc-max-width-sm: 30rem;\n\t--bloc-max-width-md: 40rem;\n\t--bloc-max-width-lg: 50rem;\n\t--bloc-animation-duration: 1s;\n\t--bloc-animation-distance: 1rem;\n\t--bloc-animation-easing: cubic-bezier(0.46, 0.03, 0.52, 0.96);\n}\n```\n\n## Grid\n\nBlock to display content in a grid of rows and columns.\n\n### Features\n\n- Display any number of items.\n- Choose the number columns to show at different screen sizes.\n- Add or remove spacing between columns.\n- Choose the number of columns and rows any individual cell should span.\n\n![grid](images/grid.png)\n\n### Custom properties\n\n```css\n:root {\n\t--bloc-grid-gap: 2rem;\n}\n```\n\n## Slider\n\nBlock to display content in a slider, or carousel (i.e. a slider with multiple slides shown at once).\n\n### Features\n\n- Display any number of slides.\n- Choose the number slides to show a once at different screen sizes.\n- Optionally add a background image to each slide.\n- Optionally link the entire slide.\n- Choose between slide and fade effects.\n- Loop slides for an inifitnte slider.\n- Show or hide the navigation arrows.\n- Show or hide the pagination i.e. bullets.\n- Add or remove spacing between slides.\n\n![slider](images/slider.jpg)\n\n### Custom properties\n\n```css\n:root {\n\t--bloc-slider-gap: 2rem;\n\t--bloc-slider-speed: 250ms;\n\t--bloc-slider-theme: currentColor;\n}\n```\n\n## Posts\n\nBlock for fetching posts, pages and custom post types and displaying them in a `grid`, `slider` or `accordion`.\n\n### Features\n- Fetch any posts, pages or custom post types.\n- Filter by any taxonomies, terms and custom fields.\n- Optionally offset posts or include sticky posts.\n- Choose specific pages, or show all subpages for said pages.\n- Order by ID, published date, modified date, title, slug, menu order, random or even a custom field.\n- Choose the number of results to display per row at different screen sizes, as well the total number of results to show.\n- Slider only options include: autoplay, loop, navigation and pagination.\n- Accordion only options include: open first item and open one at a time.\n\nWith the posts block you could choose to show all fantasy books sorted by price that are less than $20, or properties that feature waterfront views, have 3 or more bedroom and are sorted by land size.\n\n![posts](images/posts.jpg)\n\n### Templates\n\nYou can override any aspect of the display by adding template files in a folder called `bloc/posts/`, the basic template heirarchy is:\n- `grid.php`, `slider.php` and `accordion.php` will override the main template/wrapper for those display types.\n- `grid-item.php`, `slider-item.php` and `accordion-item.php` will override the template/display for individual posts within those display types.\n- `grid-item-{post-type}.php`, `slider-item-{post-type}.php` and `accordion-item-{post-type}.php` will override the template by post type, for example `grid-item-post.php` will override `grid-item.php` for posts and `slider-item-page.php` would override `slider-item.php` for pages.\n\n### Custom properties\n\n```css\n:root {\n\t--bloc-posts-gap: 2rem;\n\t--bloc-posts-slider-speed: 500ms;\n\t--bloc-posts-slider-theme: currentColor;\n\t--bloc-posts-accordion-easing: cubic-bezier(0.46, 0.03, 0.52, 0.96);\n\t--bloc-posts-accordion-duration: 250ms;\n}\n```\n\n### Filters\n\n```php\n\u003c?php\n// Filter to modify the main posts query arguments.\nadd_filter('bloc/posts/query', fn(array $args) =\u003e array_merge($args, ['author_name' =\u003e 'admin']));\n\n// Filter to set the no results i.e empty message.\nadd_filter('bloc/posts/empty', function(string $message, string $display) {\n    return __('Sorry, there were no matching results.');\n}, 10, 2);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambry%2Fbloc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flambry%2Fbloc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambry%2Fbloc/lists"}