SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Addict laburke's Avatar
    Join Date
    Jan 2005
    Location
    Michigan
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Why do my WordPress posts not retain formatting?

    I get my post lookin' all the way I want it to, but if I switch from code view to visual, or when I publish it, it doesn't maintain paragraph breaks. I've tried inserting them in both views; neither works. If you know anything about WordPress and have the time to take a look at http://www.predictidol.com, could you give me an idea why it won't do this simple thing? The commentary in blue by "Burke" comes right after the little paw marks (you'll see what I mean when you get there), when it should start on the next line.

    I'm sure it's my fault, but I just don't know how to fix it. Thanks for any help you can provide.

  2. #2
    SitePoint Enthusiast bdude's Avatar
    Join Date
    Jan 2006
    Location
    In a house.
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When you switch from Code view to Visual view, it reformats some of your code and as a result can alter some code giving undesired results.

    It's possible to disable the Visual editor completely in the Users section of your wp-admin
    SUPPORT FOR NEW BLOGGERS - TRY THE Blogging Forum

  3. #3
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Even in code view, the WordPress editor messes up basic HTML.

    Sometimes you can insert the code you want, and when you click save, it works. However when you go back to edit it later, the code gets goofed up on reloading. This is a particularly common problem for those trying to embed YouTube videos.

    I have no idea why WordPress features this glaringly apparent bug, but I'm assuming they have their reasons ... perhaps security related?

  4. #4
    SitePoint Zealot
    Join Date
    Feb 2008
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It might be worth checking the CSS too, margins, padding etc could be set to 0 or you could add these to help you separate your paragraphs.

  5. #5
    SitePoint Addict laburke's Avatar
    Join Date
    Jan 2005
    Location
    Michigan
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sometimes you can insert the code you want, and when you click save, it works. However when you go back to edit it later, the code gets goofed up on reloading. This is a particularly common problem for those trying to embed YouTube videos.

    I have no idea why WordPress features this glaringly apparent bug, but I'm assuming they have their reasons ... perhaps security related?
    You mean it might not actually be my fault? That would be a first! It's been driving me crazy when incorporating AdSense as well. It keeps defaulting to this ugly skyscraper shape with a border and gray background instead of the format I set up. It's making me nuts.

    Thanks for your suggestions, everyone. I'm going to see if I can fiddle with the styles, although I'm not really sure what I should change to make those paragraph breaks stay in place.

  6. #6
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you actually need to add Adsense directly via posts though?

    It's probably a lot less hassle and less buggy to do it via your theme if possible.

  7. #7
    SitePoint Addict laburke's Avatar
    Join Date
    Jan 2005
    Location
    Michigan
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you actually need to add Adsense directly via posts though?

    It's probably a lot less hassle and less buggy to do it via your theme if possible.
    That's true, and I have only recently learned that this is possible. I will try to insert the code directly into my theme files.

    As for the paragraphing issue, though, I'm following this discussion, where others are having the same problem. Someone there suggested looking into the CSS as CaffinePhil does above, but I can't seem to find the proper tag for the post styling. I've changed every one I can think of and tested it to see if it helped with the paragraphs, and none of them did. Ay yi yi.

  8. #8
    SitePoint Enthusiast
    Join Date
    Dec 2007
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Embed codes for Youtube videos and other similar codes are a quirk of Wordpress. What you have to do is finish your post entirely then go to CODE tab, paste your code then publish. DO NOT GO BACK to the preview tab. For some unknown reason that will cause your code to rewrite.

  9. #9
    SitePoint Enthusiast bdude's Avatar
    Join Date
    Jan 2006
    Location
    In a house.
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd dare say that the issues with YouTube/AdSense is probably part of a HTML input filter.

    Try the AdSense Deluxe plugin for implementing adsense, as it gives you a simple <!-- adsense --> code to put in your posts which then gets replaced with your ad code.
    SUPPORT FOR NEW BLOGGERS - TRY THE Blogging Forum

  10. #10
    SitePoint Member
    Join Date
    Oct 2005
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ryanhellyer View Post
    Even in code view, the WordPress editor messes up basic HTML.

    Sometimes you can insert the code you want, and when you click save, it works. However when you go back to edit it later, the code gets goofed up on reloading. This is a particularly common problem for those trying to embed YouTube videos.

    I have no idea why WordPress features this glaringly apparent bug, but I'm assuming they have their reasons ... perhaps security related?
    Yup... This is exactly how I spent one recent afternoon... Very frustrating.

    Just when you think everything is perfect in the post, there's a typo... Go back in to fix it, and all the formatting gets messed up (links to YouTube videos in my case).

    Finally, I got smart, edited all of the code in a text editor, then when I was sure it was perfect, pasted it in to Wordpress.
    "Hi, my name is Tom, and I'm a web hosting addict..."
    A few of my most recent addictions include:
    Blog About Nothing~Death Etc.~Sebral~Café Sherrie~Champ Money

  11. #11
    SitePoint Addict laburke's Avatar
    Join Date
    Jan 2005
    Location
    Michigan
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Finally, I got smart, edited all of the code in a text editor, then when I was sure it was perfect, pasted it in to Wordpress.
    I've tried getting it all set in Word and then pasting, but it doesn't keep the bold or italics, so I have to do it in Wordpress anyway. Plus how do you see a visual representation of it to be sure it's right? I'm not comfortable enough with code to really know how it's going to look.

  12. #12
    SitePoint Member
    Join Date
    Oct 2005
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by laburke View Post
    I've tried getting it all set in Word and then pasting, but it doesn't keep the bold or italics, so I have to do it in Wordpress anyway. Plus how do you see a visual representation of it to be sure it's right? I'm not comfortable enough with code to really know how it's going to look.
    Well, by "text editor" I meant a true text editor (PSPad in this case), not a word processor.

    That part wasn't hard for me to do, since I've been working with code and designing websites for about 15 years (but have only been blogging for a few). In fact, that's probably what made it so frustrating - I could code everything exactly where I wanted it, and it would remain in place when I pasted it into WordPress and saved, but if I went back to make a minor change (say, adding a comma or period), the whole page would be screwed up.

    As an OCD-anal-retentive-perfectionist, I can assure you, my blood pressure was not in the healthy range that day.

    I love WordPress, so I'll put up with it's quirkiness.
    "Hi, my name is Tom, and I'm a web hosting addict..."
    A few of my most recent addictions include:
    Blog About Nothing~Death Etc.~Sebral~Café Sherrie~Champ Money

  13. #13
    SitePoint Addict BlazeMiskulin's Avatar
    Join Date
    May 2007
    Location
    Wisconsin
    Posts
    330
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wp-includes/functions-formatting.php

    Edit that file to remove all the changes you don't want to happen. Just remember that this file will be replaced on an upgrades and you'll need to make the changes again.
    M Blaze Miskulin
    President
    Geek Niche Web Hosting

  14. #14
    SitePoint Member
    Join Date
    Oct 2005
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, editing it now!
    "Hi, my name is Tom, and I'm a web hosting addict..."
    A few of my most recent addictions include:
    Blog About Nothing~Death Etc.~Sebral~Café Sherrie~Champ Money


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •