Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Somehow the WordPress editor doesn't have a button to insert a horizontal line (<hr /> in html). Is there a plugin that adds this button? Or an easy way to add such a button myself?

share|improve this question
    
I am upvoting your question not because for me it is something hard to make, but because I am curious to understand why it is not included by default in the editor. Probably it has to do with the fact that HTML shouldn't care about the graphics, but only about the content (and therefore you should prefer using css border property to achieve the same result) ? –  jj_ Jan 10 at 2:43

1 Answer 1

up vote 7 down vote accepted

There's an easy way. Open functions.php and add this code. It works for many html entities

// got this form http://www.sycha.com/wordpress-add-hr-button-tinymce-visual-editor

function enable_more_buttons($buttons) {
  $buttons[] = 'hr';

 /*
  Repeat with any other buttons you want to add, e.g.
  $buttons[] = 'fontselect';
  $buttons[] = 'sup';
 */

 return $buttons;
}

add_filter("mce_buttons", "enable_more_buttons");
//add_filter("mce_buttons_2", "enable_more_buttons"); // add to second row
//add_filter("mce_buttons_3", "enable_more_buttons"); // add to third row
share|improve this answer
3  
The TinyMCE documentation has a list of all buttons available in the standard distribution. –  Jan Fabry Dec 29 '10 at 8:16
    
I'm not sure if I found the right functions.php ... when I added it to the end of wp-includes/functions.php, I got an error that "add_filter" was not found. –  Hinek Feb 12 '11 at 10:14
    
@Hinek I´m sorry for the terribly late answer, but we are talking about the functions.php file located within your theme... but at this point, maybe you found out already! –  Sergio Majluf Apr 14 '11 at 0:12

Your Answer

 
discard

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.