Adjust line spacing within a specific post

Community Forums Forums Design Tips and Tricks Adjust line spacing within a specific post

This topic is: resolved

This topic contains 5 replies, has 2 voices, and was last updated by  braddalton 10 months, 1 week ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #62088

    christine123
    Participant
    Post count: 18

    Hello!

    How do you change the line spacing on a specific post? I’ve Googled and searched the forums on this topic. I know how to change the line spacing for all posts, but I can’t figure out how to do it for one specific post.

    I’m running WordPress 3.6.1. My web site is http://www.YoureSomethingElse.com. The post I want to decrease the line spacing is titled Lead the Way. I want to change the spacing from 25px to 5px.

    Using Firebug, I have identified the line of code I want to change, which I believe is line 708. My problem is I don’t know how to find that specific line of code in the Stylesheet editor.

    I understand FTP is an option? I’ve never done FTP. I believe I can open the code somehow in a text editor, where the lines are numbered? And then FTP that updated file to my site? Seems if I could just find the line of code in the Stylesheet editor, that would be the simplest fix?

    I’ve gone to Appearance –> Edit CSS and I’ve typed in this code:

    .entry-content p {
        margin: 0 0 5px;
    }

    However that decreases all the line spacing in all the posts.

    Many thanks!

    http://www.youresomethingelse.com
    #62101

    braddalton
    Participant
    Post count: 8794

    Add a custom body class in your Layout Settings on the edit screen:
    [css]
    .your-custom-class .entry-content p {
    margin: 0 0 5px;
    }
    [/css]


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #62103

    christine123
    Participant
    Post count: 18

    Thank you for your help. Where can I find the Layout Settings on the edit screen? By edit screen, do you mean go to Appearance –> Edit CSS ?

    #62110

    braddalton
    Participant
    Post count: 8794

    Underneath your Edit post or edit page screen.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #62131

    christine123
    Participant
    Post count: 18

    Gotcha. That worked. So here’s a re-cap in case anyone needs the solution spelled out step-by-step:

    1) Make up a name for the change you want to make. I called mine: custom-body-line-spacing.
    2) Click the post or page you want to make the change to.
    3) Scroll down toward bottom of page until you see Layout Settings. Then look for a field called Custom Body Class.
    4) Type in the name you made up for the change (see step 1) with hyphens in the Custom Body Class box.
    5) Click update.
    6) Go to Appearance — Edit CSS
    7) Insert the code for the change you want to make. I inserted this:

    .custom-body-line-spacing .entry-content p {
        margin: 0 0 5px;
    }

    8) Click Save Stylesheet.

    That should do the trick. So… Anytime you want that specific change on a page or post, all you have to do is type your made up name (from step 1) in the Custom Class Box of the page/post, and the site will be changed.

    • This reply was modified 10 months, 1 week ago by  christine123.
    • This reply was modified 10 months, 1 week ago by  christine123.
    • This reply was modified 10 months, 1 week ago by  christine123.
    • This reply was modified 10 months, 1 week ago by  christine123.
    #62213

    braddalton
    Participant
    Post count: 8794

    Thanks for sharing.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Adjust line spacing within a specific post’ is closed to new replies.