Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Matthew Murray
Matthew Murray
8,488 Points

Spaces in Wordpress

Hi, I'm having trouble making spaces (line breaks) in Wordpress. For example, if I want a space between the first <h1> tags and the first <p> tags the formatting automatically deletes the space.

I've tried using <br> and </br> and   but none of them seem to work to make a simple break between the title and first paragraph. Does anyone know how to achieve this?

Thanks!

5 Answers

Matthew Murray
Matthew Murray
8,488 Points

Hi James,

There really isn't any code to post. I'd like to make a space between the H1 and P tags.

For example:

<h1> Dogs</h1> <br> <p>There are many kinds of dogs... </p>

When I do this in wordpress wysiwyg then the br or /br tag won't work. Any thoughts on how I can make the BR tags take effect?

Thanks!

jeff creamer
jeff creamer
23,733 Points

Hey Matt,

  1. Are you trying to do this in your code or are you working in the visual/text editor section of your admin dashboard?
  2. Have you tried a non-breaking space, "&nbsp" ?
Matthew Murray
Matthew Murray
8,488 Points

Hi Jeff,

Thanks for the reply!

I'm working in the visual/text editor of the the admin dashboard in Wordpress. When I use a "</br> tag in the text editor then a space gets created, but it later disappears(!) the next time I log into the page.

I've tried the "&nbsp" mark a couple of times. I've had some success, but just like with the "</br> tag the space created disappears shortly after I re-enter the same page for further edits.

I'm sure other wordpress users must have experienced this problem before. Anyone know how they resolve it short of putting a "." in the color of the background?

Thanks!

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

The WordPress content editor is a little famous for stripping out code like this. If you're going to need to format your HTML like this, make sure to only use the Text editor version and not the visual editor.

Matthew Murray
Matthew Murray
8,488 Points

Hi Zac,

Thanks for the suggestion. I'll give it a try and see what happens.

Cheers!