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?

  • 1
    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/). Commented Jun 3, 2013 at 19:36
  • That doesn't seem to work. Commented Jun 3, 2013 at 21:17

1 Answer 1


@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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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