Title: Text editor &#8211; Custom Center Button Code
Last modified: August 20, 2016

---

# Text editor – Custom Center Button Code

 *  [impload](https://wordpress.org/support/users/impload/)
 * (@impload)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/text-editor-custom-center-button-code/)
 * In the wordpress editor, currently when we center an image, it adds `class="aligncenter"`
 * to the image code.
 * I would like the center button to instead wrap the image code in this:
 * `<div align="center"> IMAGE CODE HERE </div>`
 * How can this be done?
 * Thanks!

Viewing 1 replies (of 1 total)

 *  [Jorge](https://wordpress.org/support/users/jas956/)
 * (@jas956)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/text-editor-custom-center-button-code/#post-2266799)
 * Make your own shortcode plugin and shortcode button to do it automatically. Hope
   this helps.
 * [http://codex.wordpress.org/Shortcode_API](http://codex.wordpress.org/Shortcode_API)

Viewing 1 replies (of 1 total)

The topic ‘Text editor – Custom Center Button Code’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Jorge](https://wordpress.org/support/users/jas956/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/text-editor-custom-center-button-code/#post-2266799)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
