Permalink structure causing HTML5 embed to fail

Hi

This question is regarding a WordPress site. I’ve posted it here as opposed to the WP category as I think it needs a little PHP help - but do say if I’ve put it in the wrong place. Here goes:

I’m building my site on a subdomain.

I am using a php include to reference a html file (it’s a HTML5 animation, in the footer) which is in the root folder, like this:

<?php include ABSPATH.'myfile.html';?>

I’ve also tried this:

<?php include 'myfile.html';?> and this: <?php readfile(ABSPATH .'myfile.html'); ?>

If I am using default permalinks, all work great.

If I choose any of the other permalinks settings, it only works on whichever page I have set to be the static front page. All other pages and posts just leave a space where the included file should be. It is actually reading the html file, as I put some dummy text in there and I can see the js files are called if I Inspect Element in Chrome. It’s just not outputting the canvas.

I have tried changing the theme to the Wordpress defaults and the problem is the same.

Can anyone please suggest anything?

Thanks

Update: I tried embedding as an iframe instead and it seems to be working!

Is there any reason not to use an iframe? Apart from the fact that I can’t seem to make it responsive!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.