=== Editorial Blocks ===
Contributors: owldraft
Tags: block, post grid, magazine, news, posts
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Gutenberg blocks for blog, magazine, news and editorial sites: post grid, post list, post hero, post group and author list.

== Description ==

This plugin adds Gutenberg blocks that are useful for blog, magazine, news and any editorial site: post grid, post list, post hero, post group and author list.

The plugin adds blocks and nothing else. There is no settings page, no dashboard widget and no onboarding wizard — you add a block, set it up in the sidebar like any core block, and you are done.

= Blocks =

* **Post Grid** — posts as a grid of cards, with a column count each for desktop, tablet and phone.
* **Post List** — posts as a list of rows, each with a thumbnail beside the text, or as stacked cards on a phone.
* **Post Group** — a featured cluster: one lead story with the rest of the posts beside it, either as a single rail or as the classic three-column homepage layout with the lead left, centre or right.
* **Hero** — one story, shown large, with the image above the text, beside it, or behind it.
* **Authors** — a grid of author cards, each with an avatar, bio and latest post.

= Choosing the posts =

Every block picks its posts the same way: by number, category, tag, author, or an explicit list of post IDs — and each of those can be excluded as well as included. Post Group and Hero can also take their lead story from somewhere else entirely, such as your sticky post or the newest post in one category, and the block will make sure that story does not then repeat further down.

= Section headings =

Every block can carry a heading above it — "Latest news", with a "See all" link beside it — set in the block's **Heading** panel. Leave the text blank, which is how a block starts, and no heading is shown at all. The heading can be aligned left, centre or right, and can have a rule above it, below it, or running along beside the words.

= Post titles =

Post Grid and Post List let you set how big a card title is — small, medium, large or huge — and, separately, which heading level it prints as. They are two different questions: the size is how the title looks, the heading level is where it sits in the page's outline. So a small title can still be an h2. Leave the size on **Default** and the title keeps whatever size your theme gives that heading.

= Notes =

Blocks render on the server, so a block always reflects your posts as they are right now — editing or publishing a post updates every block that shows it, with nothing to re-save. It is also the same code that draws the editor preview, so what you see while editing is what the page will show.

Styling is deliberately minimal. The blocks lay themselves out but inherit fonts, colours and heading sizes from your theme, so they look native rather than bolted on.

= Credits =

The comment icon is "message-circle" from [Feather](https://feathericons.com/) by Cole Bemis, used under the MIT licence.

== Recommended Theme ==

The blocks work with any theme. They lay themselves out and inherit fonts, colours and heading sizes from whatever theme you run, so there is nothing to match up and no theme you have to switch to.

They were built and tested against our own themes, all free on WordPress.org:

* [Evermag](https://wordpress.org/themes/evermag/)
* [Stoat](https://wordpress.org/themes/stoat/)
* [Rural Blog](https://wordpress.org/themes/rural-blog/)

== Installation ==

1. Upload the plugin through **Plugins → Add New → Upload Plugin**, or install it from the WordPress.org plugin directory.
2. Activate it.
3. In the editor, add a block and search for **Post Grid**, **Post List**, **Post Group**, **Hero** or **Authors**.

There is no configuration step.

== Frequently Asked Questions ==

= Does this work with any theme? =

Yes. The blocks bring the styling they need and define no colours or sizes of their own globally, so they cannot clash with your theme. If your theme sets the CSS variables the blocks look for, they follow it automatically.

= Does it work in the site editor? =

Yes. The blocks work anywhere the block editor does, including templates and template parts in a block theme.

= Will it slow my site down? =

It shouldn't. There are no page builder libraries, no jQuery and no front-end JavaScript — a block is plain HTML and a small stylesheet, and a block's stylesheet is only sent to a page that actually uses it.

== Changelog ==

= 1.2.0 =
* Post List: a **Spacing** setting in the Layout panel — none, tiny, small, normal, large or huge — for the space between one story and the next. Existing lists stay on Normal, the spacing they have always had.
* Post List: a **Vertical align** setting — top, middle or bottom — for how the picture and the text sit against each other when one is taller. Middle is the default, as before.
* Post List: **Grid on mobile**. Turn it on and, on a phone, each row becomes a card with the picture above the headline, across the full width. Off by default.
* Post List: on a narrow row the thumbnail now gives way before the text does, so a headline is never squeezed into a column of single words.
* Post Grid: a **Spacing** setting in the Layout panel — none, tiny, small, normal, large or huge — for the space between the cards, across and down. Existing grids stay on Normal.
* Post Grid, Post List, Hero and Post Group: an **Author avatar** toggle, which puts the author's picture in front of the byline. A site with avatars switched off in Settings → Discussion keeps a text-only byline.
* Hero and the Post Group lead story now show the author, with the avatar, by default. This includes blocks you have already placed; switch **Author** off in the block's settings to go back.
* Hero and the Post Group lead story print the featured image's caption under the picture, when the image has one — the place for a photo credit.
* Post Group, list stories: the thumbnail can now be sized (from the small 60px square up to 200px or 40% of the row) and cropped to any of the shared shapes, and the story title given one of the four named sizes. Blocks you have already placed keep the small square and the same title size.
* Post Group: the "1/2 + 1/2 — even" layout is now genuinely even. A long headline or a wide image could push its column past its half; the columns now hold their ratio whatever is inside them, as do the other layouts.
* Authors: authors with the same number of posts are now listed by name, so their order is predictable.
* Tested up to WordPress 7.1.2.

= 1.1.1 =
* Post Grid and Post List: the title size can now be left on **Default**, which prints no size of the plugin's own and leaves the title at whatever size your theme gives that heading level. The four named sizes are unchanged, and blocks you have already placed keep the size they were set to.

= 1.1.0 =
* Every block can now carry a section heading above it — the words, an optional "See all" link beside them, left/centre/right alignment, and a rule above, below or running alongside. Blank by default, so nothing changes until you fill it in.
* Post Grid and Post List: choose the size of a card title (small, medium, large or huge) and its heading level (h2, h3 or h4) separately, so the way a title looks no longer decides where it sits in the page outline.
* The version used to cache-bust the plugin's CSS and JS is now read from the plugin header instead of being typed a second time, so an update can no longer ship new styles that a browser keeps serving from its cache.

= 1.0.0 =
* Initial release.
* Five blocks: Post Grid, Post List, Post Group, Hero and Authors.
* Every block picks its posts by number, category, tag, author or an explicit list of post IDs, and each of those can be excluded as well as included.
* Post Group and Hero can take their lead story from somewhere else — a sticky post, or the newest post in one category — without it repeating further down.
* An optional comment count on a post card, off by default, hidden on a post that has no comments.
