WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know there are plugins that do this, but since my needs are so small, I'm hoping there's another solution...

I want to edit the <hr /> style in the WordPress editor to have clear: both;. Is there a way to do this in the functions.php or something?

share|improve this question
This sort of thing is best done with CSS. Just add the necessary CSS rule to the style.css in your theme folder (/wp-content/themes/theme-name/). – montrealist Jun 3 '13 at 19:36
That doesn't seem to work. – Rev Jun 3 '13 at 21:17
up vote 1 down vote accepted

@dalbeab already answered your question, but thought I would point out a way to add horizontal rule to your editor if you wish.

Within functions.php, you can add this:

// add horizontal rule button
function enable_more_buttons($buttons) {
    $buttons[] = 'hr';
    return $buttons;
add_filter('mce_buttons', 'enable_more_buttons');

Then you will have a TinyMCE button that looks like this which will let you add an <hr /> with only 1 click:

enter image description here

share|improve this answer
Actually @dalbeab's answer didn't work. – Rev Jun 3 '13 at 21:17
You are talking about editor styles as opposed to the styles the end user sees? In that case you want to look at: Function Reference/add editor style « WordPress Codex – GhostToast Jun 3 '13 at 21:31
Thanks, that helped! – Rev Jun 4 '13 at 15:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.