How do I create a Wordpress page for the WebGL Player?

These are the files created from a WebGL build. Which files to I need to bring into Wordpress, so it can work on my website.

Also, do the files need to be transferred to the server, or remain on the machine here? Thank you lots for any help in advance.


I know it’s an old question, but I’ve just used the following piece of code to overcome this issue easily:

<iframe src="https://your.domain/buildfolder/index.html" width="900" height="600"></iframe>

I have managed to get a webgl unity game working on WordPress, although note that you will need to have your own hosted WordPress, not one from to make it work I had the unity build files added to my Dropbox public folder (should also work if files are hosted on same hosting as site) using a plugin called iframe. With this you simply write in the text box [iframe src=“insert public address of file here” width=“1000” height=“900” scrolling=“no” style=“margin-left:-35px;”] and it should work :slight_smile:

I got it to work by FTP’ing the TemplateData and Release folders under the wp-content/uploads folder. Then I created a page and added the following code in a code snippet element for my theme.

<pre><p class="header"><span>Your Game Name | </span></p>
      <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()" height="600px" width="960px"></canvas>

      <div class="logo"></div>
      <div class="fullscreen"><img src="../wp-content/uploads/TemplateData/fullscreen.png" width="38" height="38" alt="Fullscreen" title="Fullscreen" onclick="SetFullscreen(1);" /></div>
      <div class="title">BreakThoseBricks</div>
    <p class="footer">« created with <a href="" title="Go to">Unity</a> »</p>
    <script type='text/javascript'>
  var Module = {
    TOTAL_MEMORY: 268435456,
    errorhandler: null,			// arguments: err, url, line. This function must return 'true' if the error is handled, otherwise 'false'
    compatibilitycheck: null,
    dataUrl: "../wp-content/uploads/Release/Default",
    codeUrl: "../wp-content/uploads/Release/Default WebGL.js",
    memUrl: "../wp-content/uploads/Release/Default WebGL.mem",
<script src="../wp-content/uploads/Release/UnityLoader.js"></script>
<script src="../wp-content/uploads/TemplateData/UnityProgress.js"></script>
   <link rel="stylesheet" href="../wp-content/uploads/TemplateData/style.css">
    <link rel="shortcut icon" href="../wp-content/uploads/TemplateData/favicon.ico" />


 in front of the code is important since it instructs Wordpress not to mess with the code. You can check out the final result here:

Hope that helps!