• Resolved Ramkalyan

    (@ramkalyan)


    Hello,

    Last night I created a small Infographic and posted it to one of my posts.
    Then I tried to put an embed code so that people can easily copy it. However the double-quotes in the outcome seems to be different, which makes the embed code useless.

    https://beginwebsites.com/significance-of-seo-pyramid/

    This is the code I used to generate the embed code.

    <textarea style="width: 600px; height: 120px; padding: 10px;" onclick="this.select();" cols="70" rows="5"><p style="text-align: left;"><a href="https://beginwebsites.com/significance-of-seo-pyramid/"><img class="aligncenter size-full wp-image-3375? title="The SEO Pyramid" alt="The SEO Pyramid" src="https://beginwebsites.com/wp-content/uploads/2012/11/The-SEO-Pyramid.jpg" width="750? height="889? /></a><small>Like this infographic? Get more <a title="SEO Basics: From Novice to Nerd" href="https://beginwebsites.com/seo-basics-from-novice-to-nerd/">SEO?tips</a> from <a title="BeginWebsites home" href="https://beginwebsites.com/">Begin Websites</a>.</small></p></textarea></p>

    Why is the double-quotes (“) displaying differently? Can you help?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator bcworkz

    (@bcworkz)

    Did you by any chance insert it using the visual view of the post editor instead of the text view? I got similar results using visual view, but it worked properly in text view.

    The post editor does weird things to code, even in text view. Probably the best way to protect code from the editor is to pass the contents to a shortcode and let the shortcode output the code.

    BTW, there’s some syntax errors at the size parameters for The-SEO-Pyramid.jpg

    Thread Starter Ramkalyan

    (@ramkalyan)

    bcworkz, thank you for youe response.

    Actually the code you see above is not the real code I used. Somehow I can’t get it to display correctly on this forum. So I’ve put it on a PDF on google docs for reference. Here’s the link,

    https://docs.google.com/open?id=0B9epGPvQw3l8SlMxT1NIa3E3U2c

    Did you notice a ” (yellow) character instead of ” (green) in the outcome. Why is this happening? How do I resolve it?

    As bcworkz asked, did you insert that textarea with the embed code using the Visual or Text editor? When I took the code from your site and plopped it into Text, it added double quotes.

    Two options
    A) The Visual editor is converting your double quotes
    B) Whatever you copy/pasted from was using “smart quotes” (Word is typically the culprit, but other programs do it, too)

    Try writing out the embed code in Notepad, then copying it into your post from the Text editor.

    Thread Starter Ramkalyan

    (@ramkalyan)

    Hello Rebecca

    This is what I did;

    I opened up a new post, and in the visual editor I inserted the infographic, inserted the necessary texts and graphics and previewed it to make sure that the outcome was what I wanted.

    Then I switched to the text editor, copied the code, went to my usual HTML encoder (https://www.opinionatedgeek.com/DotNet/Tools/HTMLEncode/Encode.aspx),
    pasted the code in to it and got it HTML encoded.

    Finally I copied the HTML encoded code, went to my post in concern and in the editor I clicked on the text tab (text editor), and pasted the code between <textarea style=”width: 600px; height: 120px; padding: 10px;” onclick=”this.select();” cols=”70″ rows=”5″>…</textarea>

    Did I do something wrong here?

    I’m going to venture a guess that the HTML encoding portion was what did it. I don’t know though.

    I’d just copy the code <i>exactly</i> as it appears in your post (in the text editor) and place that within a textarea. Anything within a textarea will [should] be treated as plain text. See if that works, then go from there with customizing.

    Thread Starter Ramkalyan

    (@ramkalyan)

    Wow Rebecca! That was excellent!

    I pasted the exact code between textarea like you said and it solved my issue. Thank you very much. Really appreciate it.

    Thread Starter Ramkalyan

    (@ramkalyan)

    And bcworkz, thank you very much for responding to my vague description of the problem.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Problem with embed code’ is closed to new replies.