I run a free HTML5 games portal, SPC – Super Play Combo . It's built on WordPress with the GeneratePress theme and has over 3,000 games from the GameMonetize and GamePix feeds. Over the last few weeks I rebuilt the homepage in a Poki-like style, with one horizontal row per category. It looked easy. It wasn't.
Here are the real problems I ran into and how I fixed them.
1. Category rows with no duplicates
Each category (Puzzle, Arcade, Match-3, Mahjong, Quiz, Sports, Racing…) has its own page with its own game list. The homepage shows one row per category, built by a script called motore-playcombo.js .
The feeds use English category names, while my site uses Italian ones, so I made a map:
const CATEGORIE_HOME = [ ' puzzle ' , ' sparabolle ' , ' arcade ' , ' match-3 ' , ' mahjong ' , ' trivia ' , ' gamesforgirls ' , ' sports ' , ' racing ' , ' card ' , ' adventure ' , ' platformer ' , ' 2048 ' ];
Enter fullscreen mode
Exit fullscreen mode
Golden rule: each game appears in exactly one row .…