• 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

    (@lotfus)

    One remark:

    the first version of the site I am creating is public… users don’t have accounts or any such things.

    Which editor are you referring to? Text or Visual?

    Thread Starter lotfus

    (@lotfus)

    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]

    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

    (@lotfus)

    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.