• I’ve added a photo along with the code in the CSS to enable text wraping using the guide here: http://codex.wordpress.org/Wrapping_Text_Around_Images

    And I’ve added the HTML to my page using the HTML tab rather than the Visual tab.

    But although the picture shows up in the right place, some of the HTML also shows up on the finished page too!

    I’m sure this is a schoolboy error on my part, but I can’t figure out how I should enter the code to avoid this.

    The page is here: http://www.tworiverscoaching.co.uk/about-me/

    Any tips for a newbie? Don’t worry, you won’t patronise me by making it R-E-A-L-L-Y simple. I hadn’t heard of WordPress 10 days ago! (Though now I think it’s the dog’s wotsits)

Viewing 15 replies - 1 through 15 (of 20 total)
  • The code should be written like this

    <img class="alignright" alt="Val Sampson" src="http://www.tworiverscoaching.co.uk/picts/two_rivers_photo.jpg" />

    alt is an image attribute, so it must be inside the image tag

    Thread Starter colin_thames

    (@colin_thames)

    Thanks John, that’s got rid of some of the HTML code but there’s still some showing.

    Here’s the code on my HTML tab:
    <div><img class=”alignright” src=”http://www.tworiverscoaching.co.uk/picts/two_rivers_photo.jpg&#8221; alt=”Val Sampson” />
    class=”alignright size-medium wp-image-3109″
    height=”180″ width=”119″/></div>

    If you have a look at the webpage you can see that the last two lines are still showing up.

    I’ve also noticed that my site font has reverted to serif after adding the CSS in the article. Darn

    Thread Starter colin_thames

    (@colin_thames)

    It’s OK, I realised I had to get all the other attributes inside the /> of the img class.

    This is what I’ve done, but it may be wrong:
    <div><img class=”alignright” src=”http://www.tworiverscoaching.co.uk/picts/two_rivers_photo.jpg&#8221; alt=”Val Sampson” width=”119″ height=”180″ />

    This seems to have worked in terms of hiding the HTML but my editing page has gone a bit screwy. The font is small and it doesn’t recognise carriage returns when I update the page.

    Yes, there are some “rules” that you should follow when you write markup, text should come in paragraphs <p></p> and the image and the text dont need to be wrapped in a div tag, so instead of

    <div><img width="119" height="180" alt="Val Sampson" src="http://www.tworiverscoaching.co.uk/picts/two_rivers_photo.jpg" class="alignright"><br>
    I am a member of the … of Coaching.</div>

    you sould have

    <img width="119" height="180" alt="Val Sampson" src="http://www.tworiverscoaching.co.uk/picts/two_rivers_photo.jpg" class="alignright">
    <p>I am a member of the Association for Coaching, the British Psychological Society’s Special Group in Coaching Psychology, and the British Association for Counselling and Psychotherapy.&nbsp; I am a certified Master Practitioner in Neuro-Linguistic Programming (NLP) and hold a qualification from the European Mentoring and Coaching Council’s accredited Coaches’ Programme at the School of Coaching.</p>
    Thread Starter colin_thames

    (@colin_thames)

    Hi John
    That’s much better, except for some weird reason I can’t get another paragraph break later down the page where I want it.

    Also, is there some reason the photo won’t line up with the top of the text?

    well in that area you’re using another div, again it should be a paragraph with the em tags inside, you should use the visual editor and after that if you need some ajustments you jump into the html

    Thread Starter colin_thames

    (@colin_thames)

    Great, I had <div></div> tags instead of <p></p> tags, but it was actually the Visual editor that had put them in, not me. The visual editor is acting a bit screwy on this page. It’s fine on others. It’s even showing the text in a different font. Anyways, at least the webpage now looks nearly right as far as the text is concerned.

    How can I align the top of the image with the top of the first paragraph please?

    this is your code, http://cl.ly/7h5G double check that all tags are properly closed or use the code i provided before

    Thread Starter colin_thames

    (@colin_thames)

    Thanks John
    This seems to have lined up the image, but I’ve got a more serious problem, not because of your code but because I think my wordpress installation isn’t working properly. If I add HTML code, then update the page, it’s gone.

    All the paragraphing has gone and i can’t get it back. I’m not sure if it would be a Plugin or my changes to the CSS code earlier.

    I’m not sure what to do.

    Perhaps I should open up a new post with the problem

    Many thanks for all your help though
    Best wishes
    Colin

    Open the html editor for that post, delete everything and paste this

    <img width="119" height="180" alt="Val Sampson" src="http://www.tworiverscoaching.co.uk/picts/two_rivers_photo.jpg" class="alignright">
    <p>I am a member of the Association for Coaching, the British Psychological Society’s Special Group in Coaching Psychology, and the British Association for Counselling and Psychotherapy.&nbsp; I am a certified Master Practitioner in Neuro-Linguistic Programming (NLP) and hold a qualification from the European Mentoring and Coaching Council’s accredited Coaches’ Programme at the School of Coaching.</p>
    <p>The work I do with corporate clients is made more effective by my understanding of the dynamics of personal relationships gained from my wider training.&nbsp; I am a Cognitive Behavioural couples&nbsp;counsellor and have run a successful private relationship counselling practice since 2004.</p>
    <p>I am a former journalist and still write extensively on coaching and relationship issues.&nbsp; I have written four books looking at different aspects of relationships and contributed to programmes on the BBC, ITV and Channel Five.</p>
    <p style="text-align: center;"><em>Val’s coaching supported me through a major reorganisation at work and helped me achieve tangible goals. She created a safe space and an unobtrusive structure to facilitate my creative thinking…. She made a very positive difference to my work life. &nbsp;&nbsp; (</em>Senior Manager, Big 4 financial services firm)</p>

    and it should be fine i hope 😉

    No problem 😉
    Best wishes

    I see in your page that you still have the image wrapped in a paragraph, remove it and it will be good

    Thread Starter colin_thames

    (@colin_thames)

    Hi John
    Your cide seemed to work well. But I’m not sure what you mean? Remove it?
    I pasted the code exactly as you gave it.

    I replaced the CSS file with a backup and the visual editor seems to be working.

    WordPress seems to be wrapping the image in a paragraph, which is a problem, since you want it aligned to the text.

    If its a problem, try

    <div><img width="119" height="180" alt="Val Sampson" src="http://www.tworiverscoaching.co.uk/picts/two_rivers_photo.jpg" class="alignright">
    <p>I am a member of the Association for Coaching, the British Psychological Society’s Special Group in Coaching Psychology, and the British Association for Counselling and Psychotherapy.&nbsp; I am a certified Master Practitioner in Neuro-Linguistic Programming (NLP) and hold a qualification from the European Mentoring and Coaching Council’s accredited Coaches’ Programme at the School of Coaching.</p></div>
    <p>The work I do with corporate clients is made more effective by my understanding of the dynamics of personal relationships gained from my wider training.&nbsp; I am a Cognitive Behavioural couples&nbsp;counsellor and have run a successful private relationship counselling practice since 2004.</p>
    <p>I am a former journalist and still write extensively on coaching and relationship issues.&nbsp; I have written four books looking at different aspects of relationships and contributed to programmes on the BBC, ITV and Channel Five.</p>
    <p style="text-align: center;"><em>Val’s coaching supported me through a major reorganisation at work and helped me achieve tangible goals. She created a safe space and an unobtrusive structure to facilitate my creative thinking…. She made a very positive difference to my work life. &nbsp;&nbsp; (</em>Senior Manager, Big 4 financial services firm)</p>

    Thread Starter colin_thames

    (@colin_thames)

    Thanks John, with a tiny bit of tweaking that was spot on. Sorry about the delay in replying – I had to get some sleep!

    Interestingly, despite pasting your code into the HTML space, WordPress (3.1.3) rearranged the HTML as soon as I switched between the HTML and Visual tabs. Here’s the final text, you’ll notice how WordPress has rearranged the first line. But it all lines up fine.

    Thanks again for your help and your patience.
    Warmest wishes
    Colin

    <div>

    <img class=”alignright” src=”http://www.tworiverscoaching.co.uk/picts/two_rivers_photo.jpg&#8221; alt=”Val Sampson” width=”119″ height=”180″ />

    I am a member of the Association for Coaching, the British Psychological Society’s Special Group in Coaching Psychology, and the British Association for Counselling and Psychotherapy. I am a certified Master Practitioner in Neuro-Linguistic Programming (NLP) and hold a qualification from the European Mentoring and Coaching Council’s accredited Coaches’ Programme at the School of Coaching.

    </div>
    The work I do with corporate clients is made more effective by my understanding of the dynamics of personal relationships gained from my wider training. I am a Cognitive Behavioural couples counsellor and have run a successful private relationship counselling practice since 2004.

    I am a former journalist and still write extensively on coaching and relationship issues. I have written four books looking at different aspects of relationships and contributed to programmes on the BBC, ITV and Channel Five.
    <p style=”text-align: center;”>Val’s coaching supported me through a major reorganisation at work and helped me achieve tangible goals. She created a safe space and an unobtrusive structure to facilitate my creative thinking…. She made a very positive difference to my work life.
    (Senior Manager, Big 4 financial services firm)</p>

    I’m glad it’s working now, just a sugestion, when you edit the code in the html editor, you should save while in there, i think that way wordpress keeps the code you’ve written and doesn’t add anything, after saving you can change to visual, but dont save while in visual 😉

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘html code showing up on page rather than hidden’ is closed to new replies.