0

I Know this may be the repetitive question, But whatever solutions are given, nothing is helping me..

I have created the page

http://creditsmart.in/wp-content/themes/voice/emicalc.html

I want to add this page to my WordPress Page Only..

1) I have tried 'text' mode using iframe. Nothing happened..

2) I have directly put my html in WordPress page.. Nothing happened..

3) Also, Whatever css and JS the above (emicalc.html) page is referencing to, I have put the same reference to header.php also. and then i tried to put tag in the Wordpress page.. Still Nothing happened..

I dont want to use any plugin. Please

Video shared for better understanding of problem - http://tinypic.com/r/2d93709/9

Any help shall be highly appreciated

  • What about a shortcode? – jgraup Feb 28 '16 at 4:46
  • @jgraup - I dont want to use any plugin. Please – Amul Bhatia Feb 28 '16 at 4:53
3

You can't because it's a non-secure page http but you're loading into an https page. It's called Mixed Content.


Adjust your protocol to // and hope it renders over https.

<iframe src="//creditsmart.in/wp-content/themes/voice/emicalc.html" name="frame1" scrolling="auto" frameborder="no" align="center" height = "300px" width = "100%">
</iframe>

( iframe code modified from @Ittikorn's answer )


If the file is in your same theme directory it's possible to create a shortcode:

[emicalc]

Then render the local file:

function emicalc__shortcode( $atts ) {

    $content = file_get_contents( get_stylesheet_directory() . '/emicalc.html');
    return $content;
}

add_shortcode( 'emicalc', 'emicalc__shortcode' );

If it's remote you might be able to use wp_remote_get() instead of file_get_contents() but it requires you pull the contents using the server instead of allowing the client to do it.


There is no other trick / https can only load https / http can always load https.

  • 1
    Oh You have taken it correctly, then, how should i proceed further then ?? – Amul Bhatia Feb 28 '16 at 4:59
1

I tried to insert this iframe code into the text mode and it seems to be working. You can adjust the height value if it does not fit, but try to leave the width value at 100%.

<iframe src="//creditsmart.in/wp-content/themes/voice/emicalc.html" name="frame1" scrolling="auto" frameborder="no" align="center" height = "300px" width = "100%">
</iframe>
  • @lttikorn - I have done the same what you have said, Still the same problem exist. Please find the attached link for video sharing for better understanding..tinypic.com/r/2d93709/9 – Amul Bhatia Feb 28 '16 at 4:50
  • @user2921939, Sumit has corrected the protocal issue by removing the http in front of the url. Can you try again and see whether it solves your problem or not? – Ittikorn S. Feb 28 '16 at 7:27
  • yes, how can i render the same on https ?? – Amul Bhatia Feb 28 '16 at 7:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.