WP Games Embed Plugin
Turn your wordpress blog into a games arcade!
This beta version WordPress plugin, WP Games Embed, makes it easy to embed games into your WordPress blog by using shortcodes in your posts and pages. WP Games Embed is intended to be able to support content offered by the various free games sites out there using the codes or downloads they provide.
FEATURES
4 Different views:
- Grid view - a grid of thumbnail images linking to each game (can be restricted to a single category or parent category)
- Category view - this view includes a medium sized image and a written description of the game
- Single page view - the page where you play the game itself
- Featured Game view - this view is similar to category view, but allows you to pick the games yourself to create your own 'Featured Games' page.
Different embedding modes:
- iFrame embedding - embed iFrame content using code provided by free games sites, or use this method to display games from your own server where an html file has been provided with the free game download.
- Flash embedding - embed Flash content using embed codes provided by other sites, or embed flash games directly from your own site. You can even upload them easily using the wordpress 'Add Media' tool.
WORKING EXAMPLE
Visit Zap Gamez Arcade to see an example of the plugin in action.
INSTALLATION
- Download the plugin from the link at the bottom of this page
- Upload the wp-games-embed.php file to your wp-content/plugins folder.
- Activate the plugin from the Plugins page in WordPress.
USAGE
Use shortcodes to embed games into your posts, or to create a grid of thumbnails on a page or your home page.
Embedding a game in a post:
Shortcode: [game /]
Additional attributes:
- width - the width of the game
- height - the height of the game
- src - the url of the game (html file for iframe embedding, swf file for flash embedding)
- flash - if set to true flash embedding will be used, if set to false iframe embedding will be used. (default=false)
- thumb - the url of the thumbnail image (70px x 60px)
- main - the url of the large image (appx 300px wide)
- title - the name of the game!
- description - your description including controls etc.
- featured - whether this should be formatted as a featured game. (default=false)
- game_url - only to be used in Featured mode (when featured is set to true). See the shortcode examples below for more details.
Shortcode Example 1 (embedding game as iFrame):
[game width="640" height="480" src="http://www.example.com/games/pacman.html" thumb="http://www.mysite.com/images/pacman-small.jpg" main="http://www.mysite.com/images/pacman-medium.jpg" title="PacMan" description="This is a great game! Use the arrow keys to play." flash="false"/]
Shortcode Example 2 (embedding game as Flash):
[game width="640" height="480" src="http://www.mysite.com/games/pacman.swf" thumb="http://www.mysite.com/images/pacman-small.jpg" main="http://www.mysite.com/images/pacman-medium.jpg" title="PacMan" description="This is a great game! Use the arrow keys to play." flash="true"/]
Creating a grid of thumbnails on a page:
Shortcode: [get_latest_games /]
Additional attributes: list_category - the category id for the games you want to appear in the list.
The list_category attribute makes it possible to display the latest games under a certain category e.g. 'Arcade' or the latest games under all categories. Simply set up a main category called 'games' and then create all your games categories (action,adventure,sports, etc.) as sub-categories.
Shortcode Example 3 (thumbnail grid):
[get_latest_games list_category="2" /]
Creating a Featured Games page:
Shortcode: [game /]
Additional atrtributes: (see above)
The important attributes for creating a features games list are 'featured' which should be set to true, and 'game_url' the url where the game can be played on your site.
Shortcode Example 4 (featured games):
[game main="http://www.myblog.com/uploads/pacman-medium.jpg" title="PacMan" description="This is a great game! Use the arrow keys to play." featured="true" game_url= "http://www.myblog.com/games/pacman/" /]
[game main="http://www.myblog.com/uploads/donkeykong-medium.jpg" title="Donkey Kong" description="This is a great game! Use the arrow keys to play." featured="true" game_url= "http://www.myblog.com/games/donkey-kong/" /]
DOWNLOAD THE PLUGIN




















good work:) I am going to install it , I have also interest in the wp Mochi plugin..
Thanx for sharing
Hi Imad
Good luck! Don’t forget to post a link to your arcade here as an example…
The mochi plugin needs a bit more development to integrate the mochi ‘bridge’ which gives the scoreboard functionality etc.
Sam
[...] the WP Super Cache plugin, which speeds it up a lot! I have also developed a wordpress plugin WP Games Embed (very much a beta at the moment) which allows you to embed games in a wordpress blog with various [...]
Hello Sam and thanks for this wonderful plugin.
I only have a slight problem with the get_latest_games shortcode. Every time I put in and define the category (for example 20) it lists all content from all categories. It might be a bug or might be something that I’m looking over.
Thanks for your help
Hi Acrylic
The get_latest_games shortcode will return all posts under a category, and all posts under child categories of that category. So if you have a main category called ‘games’ with an id of 1 and sub-categories of games such as ‘action’ (id =2), ‘arcade’ (id = 3), ‘fighting’ (id =4), etc. if you call category 1 in get_latest_games you will get all games, but if you call category 2 you should just get ‘action’ games.
If this doesn’t help please comment again as it is this type of feedback that helps me to develop and improve my plugins over time.
Sam
Hi Sam!
I tweaked the code a bit and now it’s doing what I need. My concept was to have the grid system represented on a separate wordpress page rather than in a single post.
So I created a new page template. The problem that I encountered was that the page template gets the content by running the loop first but the ep-embed.php runs the loop again. So what happens is that the page template loops through all the posts you have and displays the content.
What I did was that I omitted the while loop and left the if conditional in. In this way the loop only runs when you have a content in your page and retrieves it. Once it happens it activates your function call which loops through the given parameters and retrieves all the game posts.
I hope I made sense :/
Interesting plugin, no doubt - however I have interesting dilemma, is there some kind of limit how many games is needed before grid appears? On my site it’s not working, at least not yet.
thank you so much for sharing this plugin. really helpful to my game site
Hi, great plugin.
One question, if we use feeds to get mochi games can we use this plugin to show those games in posts?
[...] wp-games-embed-plugin [...]
Hi,
I’m trying to get this to work, but can’t quite get it right. The plugin is activated - and this is code that I’m trying to use - (I changed example.com and mysite.com to our site)
[game width="640" height="480" src="http://www.skuzziport.com/games/pacman.html" thumb="http://www.skuzziport.com/images/pacman-small.jpg" main="http://www.skuzziport.com/images/pacman-medium.jpg" title="PacMan" description="This is a great game! Use the arrow keys to play." flash="false"/]
grateful for tips!
Hi Eoin
In what way is it not working? Do you have an example I can look at?
Thanks for this little plugin…it works a treat.
I’m gonna use it to add games as I go along, and then put a category page up… in the meantime I’ll just add each game I find as a blog post.
The 1st game attempt can be found here….
http://www.foundstuff.co.uk/2009/magic-towers-solitaire-an-addictive-little-solitaire-game/
Excellent plugin and simple to use.
Well it seems to me to be quite useless, the grid view shows evey post of the whole blog, fine if 2-3 is all you have, but when in the 1,000s very terrible.