• Resolved nickb34

    (@nickb34)


    Hey everyone, Ive got an install of WordPress and im trying to get it to keep <br> or
    tags in my posts. If i am posting an HTML story, or even typing the spaces in myself, they still get filtered out.

    I have looked at about 10 different threads, including:

    https://www.ads-software.com/support/topic/52958?replies=19

    I have tried countless plugins, changing Tiny MCE.js properties, and even tried changing some things in functions-formatting.php. No luck.

    How can you have spaces in your post??? What if you want 4 or 5 lines between something? If there is a fix I would greatly appriciate a post explaining how to do this.

    Thanks in advance.
    –Nick

Viewing 15 replies - 16 through 30 (of 32 total)
  • instead of line-height, I would suggestion margin-top, but it amounts to the same thing.

    <p style="margin-top: 4ex;">there should be a 4 x height space before this line</p>

    Oh, and I was checking into the rights of each role, and discovered something that might be a factor. It seems there is an “untiltered html” setting for the admin, and editor roles, but it’s switched off for authors and below. In other words, it filters for authors and contributors. Perhaps this is where your html is being altered against your will! You can get the Role Manager plugin that will let you specifically set that for individual users.

    Thread Starter nickb34

    (@nickb34)

    Alright, i altered the CSS, and I guess it puts more spacing in between the paragraphs, but there still not spaces.

    The whole point of the thread is to be able to put spaces in, with breaks, not just to increase the space between paragraphs, or tags, seems like a simple thing, but its turning out to be a complicated matter.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Nick: Above, where you say it filtered out the break tag… What do you mean? It didn’t filter out the break tag, the break tag did exactly what it was supposed to do, it went to a new line.

    What I see on your above post:
    Still filtering the
    's out.

    See? Two lines. The break did what it does, it added a line break.

    Maybe if you posted a link to your blog so that we could see the resulting problem posts you’re making, we’ll be able to give you better advice.

    Thread Starter nickb34

    (@nickb34)

    Hey, i see your point. Its still not doing what i want it to do. What if you want 10 of them? What if you want to type a little bit, put 10 spaces and then continue?

    Please see here:

    https://www.nickb.ca/breaks

    I have tried this process with the editor on off, manually entering the code, or hitting enter and return, its all the same.

    Hope that gives you a better understanding,
    –nick

    I know exactly what Nick is saying… In previous versions and with previous WYSIWYG editors (for wordpress), you could have extra spaces.

    If you enter the following:
    paragraph of text1
    hit enter 5 times
    paragraph of test2

    You get:
    paragrahp of text1
    paragraph of text2

    I too would like the editor to allow more CR/LF when wanted. And using the HTML button and using the source doesn’t solve the problem either.

    I’m confused about something. Why can’t the space be created using an inline style instead of br tags?

    And did you check out the “unfiltered html” issue I mentioned for admins, editors, and authors?

    Thread Starter nickb34

    (@nickb34)

    I want it to be quick, i dont want to have to mess around with styles in the post to get a couple spaces in.

    Also, i made another user as an author and tried it and still no luck. I have not tried the plugin however, but i will definately check it out.

    Heck, as I just found out, the editor removes breaks from blockquotes too. So if I’m blockquoting what a person said, it no longer has the formatting of that how they typed it.

    I believe the WP filters are whats doing it. You should be able to disable any filter, it’s just a question of finding which one is removing the extra break lines.

    If I had to guess, it’d be wpautop. So to disable it, throw this inside your template’s funtions.php:

    remove_filter(“the_content”, “wpautop”);

    wpautop can be found in functions-formatting.php, line 57. For other filters that WP uses, take a look in default-filters.php and kses.php line 523. All filter functions (with the exception of kses) can be found in functions-formatting.php.

    Hope this helps.

    EDIT: Oh, and don’t use the rich text editor. It does more filtering which I don’t believe you can disable without hacking WP core code. Maybe I’m wrong, but the rich text editor seems to have the following filter, and I don’t see a way to disable it:

    function wp_richedit_pre($text);

    functions-formatting.php, line 1006.

    Thread Starter nickb34

    (@nickb34)

    Works! FINALLY. Thank you all very much for the help.

    The Fix:

    Add “remove_filter(“the_content”, “wpautop”);” to your themes functions.php, and disable the rich text editor.

    When entering
    tags or tags, it doesnt filter the spacing out for either of them.

    Also, if you want to use the <b>, and <i> buttons etc on the editor (the one you get when you turn rich editing off) they all still work.

    –nick

    Thank you for working through this… I too was having the same problem; it’s very frustrating when trying to format a page so that it looks halfway decent. Unfortunately, WordPress is loosing the flair it once had, at least in my opinion.

    I have found a problem though… I have no functions.php page… Any ideas?

    Thread Starter nickb34

    (@nickb34)

    Just make one in your template directory? Im not sure, thats what i would try….

    Glad you’ve got it sorted. I supposed something like this could be an option in the admin area. However, I see this as a step backwards. I view it like when I receive a document from someone that I will use in print publishing (or web or that matter), and they’ve put in returns after every line instead of only at the end of the paragraph, and they’ve inserted spaces to get text over instead of using a tab. Perhaps it takes moment longer to set a tab, but that’s only once, and then you just need to hit tab. I spend a lot of time cleaning up a document I receive so it will flow properly despite the page dimensions. Same with a style sheet on a web page. You need to take a moment longer to define a style, but after that, it’s much faster to tag your content appropriately and let css do the spacing. I don’t want to turn this thread into a debate about web standards, but I do think it’s important to consider two things. One) that people who visit your site with non standard browsers have a hard time getting passed the extra br’s etc. Imagine someone who is viewing with a cell phone for example (and that’s just one example). Two) Consider the work you will need to do to clean up all the extra code when you change your the style of your website. If you did in a style sheet, it can be done for all of them in about 30 seconds. If you need to manually remove all the br’s, you best order dinner in, you’ll be working late.

    I’m glad you’ve got what you wanted, but I don’t think wordpress as a whole should support that way of making pages. It rightfully cleans up a lot of junk in my opinion. The ‘new way’ is to separate style and content. There are many good reasons for this. The html tags are there to tell the browser what something is, not how it should look.

    Thread Starter nickb34

    (@nickb34)

    manstraw, I think you are right. I agree, but by the same token, you would think that such a widely used, widely supported open source blogging system would have an easy to add a couple of spaces???

    It just didnt seem right to me that something so simple could be so much work.

Viewing 15 replies - 16 through 30 (of 32 total)
  • The topic ‘Keeping Line breaks – Is there a fix?!?!?’ is closed to new replies.