• I’m having problems using the <br> tag to insert line breaks into my pages. When I try to save the page, everything else is saved fine, but all of my <br> tags are converted & saved as </br> tags and hence I get no line breaks.

    So
    A.) What is up with that?
    &
    B.) Until I can fix it, what’s the simplest work-around?

    Thanks,

    Jason

Viewing 10 replies - 1 through 10 (of 10 total)
  • Try using <br /> instead.

    Thread Starter wilytrader

    (@wilytrader)

    Thats what they are saved as and I just tried manually entering in
    but that tag just isn’t doing anything.

    See for yourself,

    https://www.wilytrader.com/candlestick-charts-explained/

    I put 10 of them above the google-ad at the bottom of the page. But it didn’t add any breaks.

    I was able to find a work-around
    &nbsp;<br />
    &nbsp;<br />
    &nbsp;

    That’s what I did in order to get the spaces that are there, but <br> or
    just doesn’t seem to be working anymore…used to though.

    Any thoughts?

    WordPress will insert them for you, all you need to do is press “enter” once!

    Thread Starter wilytrader

    (@wilytrader)

    On mine if I press “enter” it will insert 1 page break, but not multiple page breaks. So when trying to separate sections of my webpage by more than 1 line, hitting enter won’t cut it.

    Few things come to mind.

    1) Which editor are we using? When I was dabbling with that wysiwyg thing, I had to hit enter twice for each <br /> and just once to get a new set of <p> ... <p> tags. Some others had different experiences though.

    B) Have you tried disabling the wysiwyg editor?

    3) Why not embed the google stuff into your theme files instead of having to add it to each post?

    D) there is no D

    Thread Starter wilytrader

    (@wilytrader)

    I am just using the WordPress Dashboard for editing. I’m affraid that I don’t know what the wysiwyg thing is nor how to disable it.

    I do have the google ads embedded into my theme as well, but I like to put them into each post too…but that’s not the concern really…its more of how I can control the layout in general.

    I tried hitting enter for the
    tags with once, twice, & even 3 times just to make sure, but still nothing changed. I don’t know why its not working anymore.

    only thing that seems to work is writing   on multiple lines, which isn’t that bad of a work-around, i just am curious as to why <br> /
    no longer works. What is this wysiwyg thing you speak of?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Your problem is that you are trying to insert more than one BR tag in a row. WordPress doesn’t allow that, and reduces them to a single BR tag. This is by design.

    WordPress auto-formats your posts. Formatting you put in will get reworked after the fact.

    Thread Starter wilytrader

    (@wilytrader)

    So what is the best solution to putting in multiple line breaks? I never used to have this problem, it seems to have changed recently for some reason?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    There is no solution to put in multiple line breaks. WordPress does not allow that, or rather, it will convert them to a single line break.

    You could change how WordPress works if you want to hack the PHP, but by default, there’s no setting anywhere that will let you do what you’re talking about.

    Anyway, to be quite straightforward about it, you really shouldn’t be doing that. The whole point of CSS is to let you do that in other ways. Separate the content from the formatting. The content is what you type in. The formatting is things like spacing and line breaks and such. Why do you really want multiple line breaks anyway? Have you considered that there may be a better way to accomplish your goal here?

    It’s like when you write for a newspaper. The first thing that any newspaper does with any incoming stories is to rip out all the formatting and throw it away. They just take the text. The goal is to make a unified format which the whole paper, or website, adheres to. If you want to stick in extra spacing, then there’s better ways. Create an empty div with a “spacing” class in your content, then adjust the spacing height in the CSS, for example. Although even that is not a good idea in general, since “spacing” doesn’t describe content, it describes format.

    Figure out why you want to insert multiple line breaks, and then somebody will be able to tell you the right way to do it. The “why” is just as important as the “how”.

    The proper way to add space is through css. you could add do this for example:

    <p style="margin-top: 6ex;">This line will have space above equal in height to 6 letter x's.</p>

    even better would be to create a style in your css file that does that, and then you just tag your line appropriately with a class attribute. for example, if you did:

    <p class="biggapper">This line will have a gap before it shows up/</p>

    And then added to your css file:

    .biggapper { margin-top: 6ex; }

    you would be doing your gap ala modern standards. The real benefit to this is you can changet he gap in the future for every occasion of biggapper in your html merely by changing the css value ONCE.

    We’re supposed to separate style from content these days.

    But if you really insist on putting in multiple breaks, you can create a functions.php file in your theme, and add code that will disable the automatic removal of them. If you search this forum for wpautop, you’ll find a thread where it’s explained how. You will also likely need to disable the visual editor for your account, and click off that option for fixing xhtml nesting (I forget what it’s called, I think it’s under writing options).

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘<br> Tags malfunctioning’ is closed to new replies.