The standard WordPress blocks are great- all the essentials for one’s website needs. In case there isn’t something that they want, they can just install one of thousands of available plugins.
I want to make my own plugin. I’ve been playing a lot of Balatro lately, and I feel that it would be cool to have a card block. Essentially, I want to be able to make a “hand” of cards that can be iterated through by pressing left and right arrows. Cards would also be able to be flipped (an image on one side and a title and description on the back).
For example, I’m considering adding a “Song of the Month” section to this website. I would create cards for each song with the album cover on the front and information about the song on the back. Website visitors would be able to go through each card one by one to see each song.
I’ve never created a WordPress plugin before. To start, I found a YouTube tutorial series by Mr Digital. There, I found the basics- file structure, how to set the plugin’s information, etc. However, creating a custom block required some more digging.
Right now, I’m going to have to look into some CSS for the card’s two views- what I see when I’m editing, and what readers see when I post. I am by no means a CSS professional, so it’ll take some work. What you see pictured above is a portion of the editor view for my card. The text can be clicked to be changed, and there’s a button towards the bottom (not pictured) that can be used to change the album cover image.
This is passable, but the readers’ view definitely needs some more work. Definitely stay tuned.
Leave a Reply