• How can I display playing cards in a WordPress post? Example: “A deck of playing cards includes the ace of spades (As)”. I would like the actual playing card displayed in the parenthesis by using a shortcode or similar markup syntax in the editor. The playing card should be made with CSS. There are a few plugins, but none of them work. There are also latex plugins, but they does not seem to include playing cards.

    • This topic was modified 5 years, 4 months ago by Michael H.. Reason: Minor spelling issues
Viewing 3 replies - 1 through 3 (of 3 total)
  • 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.

    Thread Starter Michael H.

    (@micskidk)

    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”]’

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display playing cards in WordPress pages and posts?’ is closed to new replies.