Title: Button shortcode &#8211; why and how
Last modified: August 21, 2016

---

# Button shortcode – why and how

 *  [lotfus](https://wordpress.org/support/users/lotfus/)
 * (@lotfus)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/button-shortcode-why-and-how/)
 * Hello all,
 * I am quiet new to wordpress and did some programming long time ago… so things
   are not always straightforward for me (yet).
 * Basically what I want to know is how the button shortcode in posts works. When
   I add a shortcode button it asks me the following fields:
    – URL – Target – Position–
   Content
 * I looked over the web to find out how to use these fields (especially the first
   two), but found nothing, except things about some plug-ins that allow you to 
   insert buttons in your posts… but it looks that wordpress out of the box already
   has what I need (?).
 * **Basically this is the feature I am looking for:**
    I would like the user to
   have a section for some posts where s/he can give his email, like to subscribe
   to the article, and maybe to provide a bit more information.
 * Something like:
 * “Are you interested in knowing more about the subject? Just subscribe and we 
   will let you updated!”
 * BUTTON
 * So if you have some inputs about how to use these buttons or if you suggest another
   solution to fulfill my requirement I would much appreciate it.
 * Best,
    L.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [lotfus](https://wordpress.org/support/users/lotfus/)
 * (@lotfus)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/button-shortcode-why-and-how/#post-5096697)
 * One remark:
 * the first version of the site I am creating is public… users don’t have accounts
   or any such things.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/button-shortcode-why-and-how/#post-5096700)
 * Which editor are you referring to? Text or Visual?
 *  Thread Starter [lotfus](https://wordpress.org/support/users/lotfus/)
 * (@lotfus)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/button-shortcode-why-and-how/#post-5096703)
 * Hello, Thanks esmi.
 * I am referring to the visual.
 * but I quickly checked, on the textual this is the button code:
 * [button-blue url=”#” target=”_self” position=”left”]keep me updated![/button-
   blue]
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/button-shortcode-why-and-how/#post-5096707)
 * The two editors have completely different methods of button creation. You might
   need to look for a a plugin if you want to hack a new button into the TinyMCE
   Visual Editor as that is going to be pretty complicated.
 * The Text Editor is a little easier. The buttons are generated by wp-includes/
   js/quicktags.js. It’s relatively easy to put together a simple plugin to add 
   new buttons.
 *  Thread Starter [lotfus](https://wordpress.org/support/users/lotfus/)
 * (@lotfus)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/button-shortcode-why-and-how/#post-5096942)
 * Thanks.
 * to be sure there is no misunderstanding: I don’t want to add any new button or
   functionality in what is obviously the “TinyMCE” module in the wordpress editor
   or the default toolbar. I don’t think I need to develop any plug-in.
 * I will detail a bit more:
 * What I want is to use the functionality that is already there. When I edit a 
   post, I can obviously add a button within my post that the visitors of my blog
   can use.
 * This is how I did:
    – When you edit your post, through the visual editor, you
   have a button in the toolbar that has the “**+**” icon, when you hover over it,
   it shows “**Add Custom Shortcode**“. – When you click on it, you can select which
   shortcode you want to add… you have a long list, that includes “White button”,“
   Green button”, …, “One third”, “Two third”, etc. – When I select the button shortcode,
   a form pop up with the fields I described above: **url, target, position, content.**.–
   Then it includes this tag within your post: **[button-red url=”#” target=”_self”
   position=”left”]Button text[/button-red]**
 * What I want, is to create such a button that will direct the user to a very small
   form when s/he clicks on it (a modal window would be nice).
 * So I would like some guidance to do so. I think first of all I need to understand
   the attributes of this button. “Position” and “Content” are quiet clear.
 * More specifically:
    – What does “target” stand for? – How can I use “target” 
   and “url” to create such a button? – More generally, what are the main steps 
   I have to do to get all this thing done?
 * I looked over the web and didn’t find anything on this topic. If you have any
   such links, I would appreciate very much.
 * Thanks a lot.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Button shortcode – why and how’ is closed to new replies.

## Tags

 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 5 replies
 * 2 participants
 * Last reply from: [lotfus](https://wordpress.org/support/users/lotfus/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/button-shortcode-why-and-how/#post-5096942)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
