WordPress.org

Ready to get started?Download WordPress

Forums

editing posts, newlines (6 posts)

  1. simonkittle
    Member
    Posted 7 years ago #

    Hey,

    I've got a new WordPress site (2.0.5). I'm creating a few static pages, and I'm using just the plain HTML editor. I've got a couple of paragraphs in there, but instead of P tags I want to use BR tags to get bigger spaces and custom spaces between the paragraphs (there are some images in there, too, so I need control over the spacing).

    I've typed BR and can see these tags in the content in edit mode (if I reload the page in the editor I still see the BR tags), but, when the page is rendered in the public view, the BR tags are gone and are replaced by just one P tag so there is basically no spacing in the wordpress Page at all.

    How do I control this aspect of the content?

    Thanks!

  2. vkaryl
    Member
    Posted 7 years ago #

    You can give your p tags some "bottom space" by adding or adjusting the margin-bottom or padding-bottom in the stylesheet.

  3. simonkittle
    Member
    Posted 7 years ago #

    Hey man,

    thanks for that.

    I realise I can do that by editing the stylesheet. The problem is, some of my static pages are quite unique in that I just want to be free to put in an extra line of space here or there if i need it (I have just a few static pages, but with different graphics requirements, and different sub-headings, etc).

    If I do it in the stylesheet, then it'll apply for all p's in all the Pages, or if I restrict it with classes, well, it just becomes more hassle.

  4. simonkittle
    Member
    Posted 7 years ago #

    So is there any other way to get this functionality ?

  5. vkaryl
    Member
    Posted 7 years ago #

    You can try disabling wpautop - copy this code into notepad, save as disableautop.php, load into your plugin folder, activate. I don't know if it will help but it probably can't hurt. Note, please: this may make no difference to whether you can insert and retain <br /> tags.

    <?php
    /*
    Plugin Name: Disable Formatting
    Version: 1.0
    Plugin URI: http://elasticdog.com/
    Description: Switches wpautop formatting off for all entries.
    Author: Aaron Schaefer
    Author URI: http://elasticdog.com/
    */
    remove_filter('the_content', 'wpautop');
    ?>

    Other than that, setting up several page templates with the different spacings etc. (using different ids/classes in the stylesheet) would be the only thing I know of.

    Forgot to ask: have you tried using the html editor button to see if the <br /> tags will be retained that way?

  6. simonkittle
    Member
    Posted 7 years ago #

    Yeah that helps loads mate. Thanks for that.

Topic Closed

This topic has been closed to new replies.

About this Topic