• Our organization created a duplicate draft version of our currently published page in order to work on embedding an interactive map. We successfully embedded the map in the duplicate draft and it looks awesome. However, when we copy the coding from the duplicate draft onto our published page, the map will not show up.

    To double check the code, we made a new unplublished page and titled it “Map Test”. The code worked just find in preview. Again, we tested the code on a different published page and it did not show up there either. So it appears the code will ONLY work in draft and not in published. Why is this? How can we fix this?

    The link above is to an unpublished draft page with public visibility. As you can see, the map works fine in draft.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi,

    Sorry, the link doesn’t work for visitors. Did you try inspecting both pages to compare the HTML generated to show the map? Maybe the visual editor is stripping it down.

    Thread Starter hollywatts

    (@hollywatts)

    We have checked the code multiple times. Could it have something to do with it being a “script” code?

    Everything else on the published page looks the same except the map (which is script). So maybe the script works on draft but not published? If so, why?

    • This reply was modified 7 years, 1 month ago by hollywatts.
    Thread Starter hollywatts

    (@hollywatts)

    This is the script code I am trying to use (minus the quotes):

    “<script src=”imap5core.js” type=”application/javascript”></script><script type=”application/javascript”>imap5.init({usermap:65125107,local:true,base:””,responsivemap:true});</script>”

    Thread Starter hollywatts

    (@hollywatts)

    Can someone please help me. I am not very savvy with in-depth coding. I can handle the basics but that is about it. See the code in the previous post? It will work on an unpublished page but not on a published page.

    Hi,

    That’s exactly why it’s failing, WordPress doesn’t allow including javascript code of file inclusion in a post or page content.

    To achieve what you need, you have to either edit your theme’s code, or use a plugin that will allow you to insert javascript on a page’s content. I don’t have a plugin to recommend because I prefer to edit the theme, but try googling “wordpress plugin insert javascript”, it’s a popular subject.

    Thread Starter hollywatts

    (@hollywatts)

    Thank you so much. I appreciate your help.

    Thread Starter hollywatts

    (@hollywatts)

    I installed Code Embed Plugin and followed the directions. Created a Custom Codename, gave it a value, inserted the code etc. I am still having the same issue. It will display in Draft but not in Publish. I viewed the source code of the published page with the missing map and the code exists as it should. What else can I check or do? Thanks ??

    Weird, can you share that page’s URL? Maybe there’s some js error preventing the map from showing up.

    Thread Starter hollywatts

    (@hollywatts)

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Duplicate Draft Page looks great but Published copy does not’ is closed to new replies.