WordPress.org

Forums

iframe Not Displaying Properly in WordPress, but doing fine in regular HTML (12 posts)

  1. Cobradeathmatch
    Member
    Posted 6 years ago #

    I am working on a site for a local animal rescue, and I am using Petfinder's "Pet List Scroller" code.

    The code based on the code generator located at: http://www.petfinder.com/tools/petlist/generatepetlist.cgi

    looks like:
    \\<IFRAME src="http://fpm.petfinder.com/petlist/petlist.cgi?shelter=NC191&status=A&age=&animal=
    &title=Our Adoptable Dogs&style=1&ref=Z4NEvW4Wkr1rTA9" WIDTH=450 HEIGHT=600 MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=yes BORDERCOLOR='#000000'></IFRAME>\\

    This works fine in a regular HTML document, but when I try to put it on a wordpress page, it won't display any of the actual results.

    It comes out looking like this: http://www.anewleashonlifedogrescue.org/Production/available-dogs

    Has anyone else run into this problem or have any idea how I can correct it?

    Thanks so much!

  2. figaro
    Member
    Posted 6 years ago #

    Seems to be working...see here:

    http://educhalk.org/blog6/

    Be sure you switch the editor to html mode and don't change back to visual...stay in html mode and publish the post/page.

  3. Cobradeathmatch
    Member
    Posted 6 years ago #

    Thanks Figaro! But when I view your link I see the same error - the top and bottom of the table is there but there are no dogs listed.

    Here's an example of how it looks when it's working:

    http://www.anewleashonlifedogrescue.org/Production/availabledogs.html

  4. Cobradeathmatch
    Member
    Posted 6 years ago #

    Anyone? I am desperate to find a solution for this. Thanks!

  5. kmessinger
    Forum Moderator
    Posted 6 years ago #

  6. Cobradeathmatch
    Member
    Posted 6 years ago #

    Thanks kmessinger!

    However, the dilemma here is that this iFrame code is generated by the Petfinder service to work with their pet database.

    Again, it works fine in regular html pages - so it's inability to validate isn't preventing it from from working in non-wordpress environments. This makes me think there must be something happening in wordpress that's making the iFrame not work properly.

    Just not sure what it could be!

  7. kmessinger
    Forum Moderator
    Posted 6 years ago #

    Generated code

    \\<IFRAME src="http://fpm.petfinder.com/petlist/petlist.cgi?shelter=NC191&status=A&age=&animal=
    &title=Our Adoptable Dogs&style=1&ref=Z4NEvW4Wkr1rTA9" WIDTH=450 HEIGHT=600 MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=yes BORDERCOLOR='#000000'></IFRAME>\\

    Code on your page

    <iframe src="http://fpm.petfinder.com/petlist/petlist.cgi?shelter=&status=&age=&animal=<br />
    &title=&style=&ref=PacaMYspt86039j" width=600px height=250px marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=yes bordercolor='#000000'></iframe>

    Much different.

  8. Cobradeathmatch
    Member
    Posted 6 years ago #

    What page are you looking at kmessinger?

    The code on my pages is identical to the generated code. My pages are:

    WordPress
    http://www.anewleashonlifedogrescue.org/Production/available-dogs

    Non-WordPress
    http://www.anewleashonlifedogrescue.org/Production/availabledogs.html

  9. kmessinger
    Forum Moderator
    Posted 6 years ago #

    I was reading your &_#_38 and not seeing the published results.

    EDIT: status=A&age is what the generated has. Yours just has status=&age

    Again, it works fine in regular html pages - so it's inability to validate isn't preventing it from from working in non-wordpress environments.

    No but the inability of the WP page to validate can certainly keep script from functioning. My suggestion, replace the & with & in the script so they will validate and correct the other errors.

  10. kmessinger
    Forum Moderator
    Posted 6 years ago #

    Is this in a text widget? Your page source shows a <br />, just after animal like this animal=<br />. That is what is breaking the script.

  11. Cobradeathmatch
    Member
    Posted 6 years ago #

    Thanks, kmessinger, I'll give that a try.
    Yeah, I saw that too and I'm not sure why that's happening. I'm pasting the code as is into the WP editor and I'm only using it in HTML mode, so I'm not sure where that tag is coming from.

  12. sita82
    Member
    Posted 5 years ago #

    Hi Cobradeathmatch, I had the same issues, and I noticed that while regular HTML pages read the code just fine, Word Press inserted breaks where there were spaces in some spots. When I copied your code into a test WordPress page, I had the same result you have. I removed the space between "&animal=" and "&title", and the code displays properly.

    I realize this post is 4 months old, but checking your link I see your problem was never resolved, so hopefully this is of some use to you.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags