It’s not too hard, but… are you OK with programming it yourself, or would you need someone else to do it?
If you need someone else to do it, I’d suggest heading over to oen of the many freelancer websites and seeing who you can find there for that job.
If you can do it yourself, a shortcode is probably the easiest way. If it was me I’d set up something like this
[playing_card suit="spades" number="8"]
Then you just need to prepare each card as an image and show as required.
I am OK with some degree of programming, but I am just wondering, if this code already exist at this time in life. There is a lot of playing cards in this world.
I agree with your approach. I actually think, that a better solution would be a shortcode, that displays vector graphics, so the playing cards are super sharp on any monitor. I know of several SVG vector playing cards, but I am not sure, how the individual cards can be used in a WordPress page or post with a call from a shortcode.
The shortcode might even be as simple as the well known poker naming convention, where ace of spades is “As”, 7 of clubs is “7c” and so on. A card pair, that might be slightly overlayed, could be “As7c”.
[card As]
[card As7c]
It might, but I haven’t seen it anywhere before (not that I’ve looked too hard for it either as I haven’t needed it yet).
As for vector graphics, that’s pretty much the same thing. Just substitute the image files for whatever you want it to be. My only comment is that your shortcode syntax isn’t correct. You still need to name the variable that will hold the card name, but you are correct in saying that it can be whatever you want it to be.
‘[card card=”As7C”]’