SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Real buttons in WP posts

    Hi everyone,
    I need to create a real button in a post.
    I tried <button.......> under <a hrel....> and it is not working.
    Any idea will be wellcomed.
    Emannuel.

  2. #2
    SitePoint Member
    Join Date
    Feb 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try to use as HTML mod button in your Editor
    and can add HTML button code easy

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your quick answer.
    Do you have any code example?

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,319
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    Hi esn003. Could you provide the full code you tried?

    How are you placing this code into your posts?

  5. #5
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good morning Ralph,
    Here is the code:

    <a href="mailto:example@myemail.com?subject=~הצטרפות לרשימת תפוצה~&amp;body=‪שמך המלא בבקשה:%20"
    target="_blank">
    <button title="">הצטרפות לרשימת תפוצה</button></a>

    Thanks,
    Emanuel.
    Last edited by ralph.m; Feb 12, 2012 at 06:01. Reason: hide real email

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,319
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    OK, it doesn't work to place a button element inside a <a> element like that. A button goes inside a <form> element.

    All you need to do is style the <a> element to look like a button. Here's a simple example:

    Code:
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="utf-8">
    <title>Button</title>
    	
    <style media="all">
    .button {padding: 5px 10px; background: blue; color: white; text-decoration: none; border-radius: 5px;}
    .button:hover {background: red;}
    </style>
    	
    </head>
    <body>
    
    <a class="button" href="mailto:me@myemail.com?subject=mysubject&amp;body=sometext">Click Here</a>
    
    </body>
    </html>

  7. #7
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1. Can you place this code in a WP post?
    2. Although I learn Latin in scool when I was young, I don't know
    what "scientiam adquiro eundo" means. Will you tell me?

    Thanks Ralph,
    Emanuel.

  8. #8
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,319
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by esn003 View Post
    1. Can you place this code in a WP post?
    I'm afraid I'm not familiar enough with WP to answer that, but I would think there should be a way to insert code—through some kind of editor source view. (We'll have to wait for someone else to answer that.)

    Off Topic:

    Although I learn Latin in scool when I was young, I don't know what "scientiam adquiro eundo" means. Will you tell me?
    You are the only person ever to have asked me that. I means "I learn as I go". Or, more literally—"Knowledge I acquire while going".

  9. #9
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I love "I learn as I go".
    I am a learner myself and I always was.
    Yes, I managed to put that code in a WP post but I don't like how the button looks
    and I am trying to change the CSS part.
    Anyway, IT WORKS and I am greatfull for that.
    THANKS Ralph,
    Emanuel.

  10. #10
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,319
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by esn003 View Post
    I don't like how the button looks and I am trying to change the CSS part.
    Yes, it was just a quick example. If you want some help styling it, perhaps head over to the CSS forum.

  11. #11
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "scientiam adquiro eundo" works. Those who dare will succeed.
    the following code works and can be placed in any post.

    <input style="width: 200px; height: 24px;" onclick="subscription_request();"
    type="button" value="Send subscription request" size="17" />

    <script type="text/javascript" language="javascript">// <![CDATA[
    function subscription_request(){
    send_it = "mailto:your_account@your-provider.com?subject=~Subscription request~&amp;body=Your full name please:";
    document.location = send_it;
    }
    // ]]></script>

    Thank you for your help and inspiration.
    Emanuel.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •