How To Build Book and Book Review Cards with WordPress Blocks – WP Tavern

I used to be neck-deep into the block system through the months main as much as its debut in 2018. This additionally simply occurred to coincide with the primary November I had ever accomplished National Novel Writing Month, a 30-day problem to jot down a 50,000-word first draft of a novel. I’ve since received a second time in 2021.

As a starry-eyed, wanna-be novelist, one of many first issues that excited me concerning the block system was how writers may showcase their books with WordPress. In fact, I had no selection however to create a customized grouping of blocks to indicate off the manuscript I had someway managed to hammer out in a month.

Homepage screenshot of a theme designed for novelists.  It features a book and a sales button.
Homepage design of theme for novelists.

This was the pre-pattern period of WordPress. The interface was clunky. Issues appeared to interrupt at random. Design instruments had been virtually non-existent, however there was a little bit of magic within the air. At no level within the platform’s historical past may customers visually construct such a easy format with inventory WordPress. For all its faults through the beta run, this was the second that I grew to become a block fanboy.

It was not till months later that I launched the theme for novelists — it was a baby of one other mission that had but to launch.

For this entry within the Building with Blocks series, I wished to stroll readers via creating one of many patterns that impressed me to proceed designing and growing with the block system. As a bonus, I may also present how you can create a e book evaluate sample.

I’m utilizing the Archeo theme by Automattic all through this tutorial. Nonetheless, it ought to work with any theme that helps blocks. Additionally, you will get extra mileage out of a block theme.

E-book Card

This card is supposed to be a place to begin for authors who wish to showcase one among their books, nevertheless it may very well be utilized to any product. There are 1,000s of the way you can alter this, and I encourage everybody to customise it as soon as they’ve walked via the steps. The top end result ought to look much like the next:

Book card design that features the book cover image on the left and intro + buy button on the right.
Remaining e book card design.

The ultimate block HTML code is available via Gist. You may copy and paste it into the editor, however I encourage you to strive constructing from scratch the primary go-round. This collection is all about studying to construct with blocks. The copy-ready code is there simply in case you get caught.

Step 1: Container Group (optionally available)

WordPress post editor with a Group block that is padded and has a dark blue background.
Group block with padding and colours.

Nearly as a rule, I begin with a Group block when constructing patterns or sections of blocks. I selected so as to add it this time as a result of I wished a darkish background with some padding across the card’s content material. You could opt-out of this for those who choose.

As soon as the block is in place, add textual content shade, background shade, and padding to the block. I selected 2rem for the padding as a result of my energetic theme’s default just isn’t constant on all sides.

Step 2: Including Media

WordPress post editor with a Media & Text block.  It shows a book cover image on the left.
Media & Textual content block inside a Group.

One in all my favourite blocks in WordPress is Media & Textual content. It has so many use instances, and it’s kind of like a mini sample all by itself. On one aspect, you drop in your media. On the opposite, you add no matter content material you need.

Contained in the Group block from Step 1, insert Media & Textual content. Go forward and seize a picture of your selecting. The WordPress photo directory has lots for those who shouldn’t have one available.

The one alteration I made to this block is to set the “Media width” choice to 35 within the block choices sidebar. Relying on the scale of your picture, you might select another choice. Simply make sure to give room on your content material.

Step 3: Group (optionally available)

WordPress Media & Text block in the post editor.  Inside the text/content section is another Group.
Including an inside Group block.

Inside the Media & Textual content block, I added one other Group. It permits constant spacing, which WordPress doesn’t apply to the “content material” space of the Media & Textual content block for some cause. That is an optionally available step, nevertheless it supplies extra management over the design.

If you don’t really feel good with the spacing of your theme, you may change the “Block spacing” choice within the block choices sidebar. I adjusted this to 2rem, however it would depend upon the energetic theme.

As an apart, these are particulars I hardly ever see talked about in different tutorials—the “gotchas” and different issues that you just may encounter. I really feel like they’re useful inclusions however could be a little bit of a bore. Be happy to let me know within the feedback if you’d like me to proceed overlaying this stage of element.

Step 4: Card Content material

Media & Text block in the WordPress post editor.  Inside of the content section is a Heading, a couple of Paragraphs, and a Button.
Including Heading, Paragraph, and Buttons blocks.

The ultimate step in creating the e book card needs to be comparatively easy. I included a Heading, two Paragraphs, and a Buttons block. I encourage experimentation.

I made no adjustments to the Heading and Paragraph blocks. Nonetheless, I chosen the “Define” type for the lone Button.

And, that’s it! The inclusion of the built-in Media & Textual content block made it simpler than constructing with others. Proceed studying for those who choose reviewing books to writing and promoting them.

E-book Evaluation Intro Card

This walkthrough will take you thru making a e book evaluate (or evaluate intro) card. Like earlier than, you may snag the complete block HTML from Gist. The end result ought to look a little bit one thing like the next:

A book review section that includes the cover image on the left and the book details on the right, including a quote.
Remaining e book evaluate card intro design.

With all of the fuss over the earlier recipe card tutorial, let me preface this part with a fast be aware. This tutorial collection is about studying to construct with blocks, not creating fleshed-out options for each potential situation.

For these people who need extra, there are present options. Donna Peplinskie’s Book Review Block is a wonderful selection. It has ISBN integration, evaluate Schema, and loads of different bells and whistles. I even wrote about it back in 2020.

That is for the generally e book reviewers, individuals not beginning a evaluate website, or those that simply wish to choose up a tip.

Steps 1-3: Rinse and Repeat

A Group block in the WordPress post editor.  A Media & Text block sits in it with its own nested Group block.
Including a Group, Media & Textual content, and one other Group block.

These steps are actually the identical because the e book card above: add a Group block, add Media & Textual content, and nest one other Group contained in the content material space. The one change I made was to widen the Media part to 40 (it was 35 earlier than).

Be happy to combine this up and check out new issues. Skip the preliminary Group block if you don’t want the padded background.

Step 4: Card Content material

WordPress post editor with Media & Text block.  A Heading, List, and Quote are nested inside of its content area.
Including a Heading, Record, and Quote block.

Like the sooner e book card, add a Heading block for the e book title. This goes throughout the Group nested inside the Media & Textual content block.

The subsequent a part of the content material is the place issues divert. For the e book “information,” you could insert a Record block. Then, fill within the particulars that you just suppose are related, like so:

  • ✍️ Written by Justin Tadlock
  • 🔖 Tagged Grownup Fiction
  • 📚 Printed by Phrases & Press
  • 📅 Printed on Could 01, 2099
  • 📃 599 Pages
  • ⭐⭐⭐⭐⭐ / 5 Stars

I wished to spice issues up with just a few emoji. If that isn’t your factor, there isn’t a want to incorporate them.

In a real-world mission, I’d additionally embody a “no marker” type for the Record block, permitting the emoji to behave as fake bullet factors. Nonetheless, the theme I used to be testing with didn’t have a mode for this.

That brings us to the ultimate part. I prefer to kick off e book evaluations by together with a favourite quote. It will get me within the temper for writing concerning the e book and lets me share one thing from the writer. Subsequently, I opted for putting a Quote block as the ultimate piece.

An alternate could be a fast abstract. You may even merely dive proper into the evaluate from there or depart the area empty. It’s your card, and you are able to do what you need with it.

Leave a Reply

Your email address will not be published.