Problem editing in Visual mode

  • Unknown's avatar

    When editing a page with this markup in it:
    <a title="Link to Event form" name="Link to event form" href="#event-form"><img class="aligncenter size-full wp-image-3357" style="margin:10px auto;padding:0;" title="Button" src="http://mydomain.files.wordpress.com/2012/01/button.png" alt="Button" width="222" height="34" /></a>

    if the editor defaults to HTML mode, all is well.
    If the editor defaults to Visual, the </a> is moved to before the img tag thus:

    <a title="Link to Event form" name="Link to event form" href="#event-form"></a><img class="aligncenter size-full wp-image-3357" style="margin:10px auto;padding:0;" title="Button" src="http://mydomain.files.wordpress.com/2012/01/button.png" alt="Button" width="222" height="34" />

    How do I fix it?

    (Sorry this is my second attempt at posting this code. The first time the {a title= … etc} was stripped out. Can’t find a way of previewing what I’m posting either…..)

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Will you please post ana active link starting with http:// to the blog you are referring to when posting to these forums? Better still provided the content is NSFW (mature) will you link it to your username so it can be instantly located? Dashboard -> Users -> Personal Settings -> then scroll down to Account Details. Then scroll down to where it says ‘Website‘ select the URL for your primary wordpress.com blog and then save changes.

    Please note the accepted HTML tags here at WordPress.com and note that form codes are not included. The only event calendar we can use is the Google Calendar. There’s also a contact form we can use.

  • Unknown's avatar

    Thanks Timethief.

    The page in question is http://www.sctf.org.uk/events. Don’t think you’ll be an wiser though!

    Since I have a number of WordPress sites linked to this username your suggestion about linking a site link is not going to work.

    I don’t understand your last paragraph. Where have I used unacceptable tags? Or form codes? Or event calendars? I do confess to using contact forms though!

  • Unknown's avatar

    OK, possible answer. I had created the #link manually in the HTML editor. Removing it completely and creating it in the Visual Editor appears to fix the problem, even though the code the Visual Editor creates is the same as my original hand cranked code.

    This thread helped: https://en.forums.wordpress.com/topic/pagepost-editor-modifies-closing-anchor-tag-in-visual-mode?replies=5

  • Unknown's avatar

    a) We’ll be wiser when you link to the blog/page in question, first because we need to make sure it’s a wordpress.COM blog, second because we can examine your code ourselves.

    b) The issue is the name attribute: it’s deprecated, so you shouldn’t use it.

    c) There’s no point adding a title attribute to both the a tag and the img tag: only the one of the two shows up.

  • Unknown's avatar

    a) OK fair enough!

    b) Thanks for the info about name – loong time since I used internal links ….

    c) Agreed

    Thanks again

  • Unknown's avatar

    You’re welcome!

  • The topic ‘Problem editing in Visual mode’ is closed to new replies.