{"id":33937,"date":"2019-03-04T09:08:46","date_gmt":"2019-03-04T09:08:46","guid":{"rendered":"http:\/\/getshortcodes.com\/?post_type=docs&#038;p=33937"},"modified":"2021-08-12T09:45:30","modified_gmt":"2021-08-12T09:45:30","slug":"button","status":"publish","type":"docs","link":"https:\/\/getshortcodes.com\/docs\/button\/","title":{"rendered":"Button"},"content":{"rendered":"<div class=\"block-demo block-demo-default\">\n\t<div class=\"block-demo-viewport\">\n\t\t<p><a href=\"#\" class=\"su-button su-button-style-3d\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\"> Button<\/span><\/a><\/p>\n\t<\/div>\n\t<div class=\"block-demo-source\">\n\t\t<pre contenteditable=\"true\"><a href=\"http:\/\/&quot;#&quot;\" class=\"su-button su-button-style-quot3dquot\" style=\"color:quot#FFFFFFquot;background-color:quot#2D89EFquot;border-color:quot#2D89EFquot;border-radius:2px\" target=\"_quotblankquot\"><span style=\"color:quot#FFFFFFquot;padding:0px 10px;font-size:9px;line-height:18px;border-color:quot#2D89EFquot;border-radius:2px;text-shadow:none\"> Button<\/span><\/a><\/pre>\n\t<\/div>\n<\/div>\n\n\n<p class=\"h2\">Table of contents<\/p>\n\n<ol><li><a href=\"#description\">Description<\/a><\/li><li><a href=\"#options\">Options<\/a><\/li><li><a href=\"#examples\">Examples<\/a><ol><li><a href=\"#button-styles\">Button styles<\/a><\/li><li><a href=\"#opening-link-in-a-new-tab\">Opening link in a new tab<\/a><\/li><li><a href=\"#the-download-option\">The download option<\/a><\/li><li><a href=\"#aligning-buttons-horizontally\">Aligning buttons horizontally<\/a><\/li><li><a href=\"#icons\">Icons<\/a><\/li><\/ol><\/li><\/ol><\/li><\/ol>\n\n\n<h2 class=\"wp-block-heading\" id=\"description\">Description<\/h2>\n\n\n\n<p>This shortcode allows you to create highly customizable buttons. You can change button style, colors, size, add an icon or description. One of the most powerful shortcodes of the plugin.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"options\">Options<\/h2>\n\n\n\n<figure class=\"wp-block-table c-shortcode-options\"><table><tbody><tr><td><a name=\"option-url\" href=\"#option-url\">url<\/a><\/td><td>Button link<br><br><strong>Default value:<\/strong> Site URL<\/td><\/tr><tr><td><a name=\"option-target\" href=\"#option-target\">target<\/a><\/td><td>Button link target<br><br><strong>Default value:<\/strong> <code>self<\/code><\/td><\/tr><tr><td><a name=\"option-style\" href=\"#option-style\">style<\/a><\/td><td>Button background style<br><br><strong>Possible values:<\/strong><br><code>default<\/code><br><code>flat<\/code><br><code>ghost<\/code><br><code>soft<\/code><br><code>glass<\/code><br><code>bubbles<\/code><br><code>noise<\/code><br><code>stroked<\/code><br><code>3d<\/code><br><br><strong>Default value:<\/strong> <code>default<\/code><\/td><\/tr><tr><td><a name=\"option-background\" href=\"#option-background\">background<\/a><\/td><td>Button background color<br><br><strong>Possible values:<\/strong> #HEX color<br><strong>Default value:<\/strong> <code>#2D89EF<\/code><\/td><\/tr><tr><td><a name=\"option-color\" href=\"#option-color\">color<\/a><\/td><td>Button text color<br><br><strong>Possible values:<\/strong> #HEX color<br><strong>Default value:<\/strong> <code>#FFFFFF<\/code><\/td><\/tr><tr><td><a name=\"option-size\" href=\"#option-size\">size<\/a><\/td><td>Button size<br><br><strong>Possible values:<\/strong> Number from 1 to 20<br><strong>Default value:<\/strong> <code>3<\/code><\/td><\/tr><tr><td><a name=\"option-wide\" href=\"#option-wide\">wide<\/a><\/td><td>Set this option to <code>yes<\/code> to make the button fullwidth<br><br><strong>Possible values:<\/strong> <code>yes<\/code> or <code>no<\/code><br><strong>Default value:<\/strong> <code>no<\/code><\/td><\/tr><tr><td><a name=\"option-center\" href=\"#option-center\">center<\/a><\/td><td>Is button centered on the page<br><br><strong>Possible values:<\/strong> <code>yes<\/code> or <code>no<\/code><br><strong>Default value:<\/strong> <code>no<\/code><\/td><\/tr><tr><td><a name=\"option-radius\" href=\"#option-radius\">radius<\/a><\/td><td>Button border radius. Automatic calculation of the radius is based on the button <code>size<\/code><br><br><strong>Possible values:<\/strong><br><code>auto<\/code><br><code>round<\/code><br><code>0<\/code> (Square)<br><code>5<\/code> (5px)<br><code>10<\/code> (10px)<br><code>20<\/code> (20px)<br><br><strong>Default value:<\/strong> <code>auto<\/code><\/td><\/tr><tr><td><a name=\"option-icon\" href=\"#option-icon\">icon<\/a><\/td><td>You can upload a custom icon for this button or use a built-in one<br><br><strong>Possible values:<\/strong> Fork Awesome icon name with <code>icon:<\/code> prefix or image URL.<br><strong>Example values:<\/strong> <code>icon: star<\/code>, <code>http:\/\/example.com\/icon.png<\/code><br><br><a href=\"https:\/\/forkaweso.me\/Fork-Awesome\/icons\/\" target=\"_blank\" rel=\"noopener\">The list of available Fork Awesome icons<\/a><\/td><\/tr><tr><td><a name=\"option-icon_color\" href=\"#option-icon_color\">icon_color<\/a><\/td><td>Color of the vector icon used in the <code>icon<\/code> option. This color won&#8217;t be applied to uploaded images.<br><br><strong>Possible values:<\/strong> #HEX color<br><strong>Default value:<\/strong> <code>#FFFFFF<\/code><\/td><\/tr><tr><td><a name=\"option-text_shadow\" href=\"#option-text_shadow\">text_shadow<\/a><\/td><td>Button text shadow<br><br><strong>Possible values:<\/strong> CSS text-shadow shorthand property<br><strong>Default value:<\/strong> <code>none<\/code><\/td><\/tr><tr><td><a name=\"option-desc\" href=\"#option-desc\">desc<\/a><\/td><td>A short description below the button text. This option <span style=\"text-decoration: underline;\">is not compatible with icon<\/span>.<\/td><\/tr><tr><td><a name=\"option-download\" href=\"#option-download\">download<\/a><\/td><td>A non-empty download attribute tells the browser that the button URL should be downloaded when a user clicks on the button. The value of the attribute will be the name of the downloaded file. The download attribute is not supported in IE or Edge (prior version 18) and in Safari (prior version 10.1). <a rel=\"noreferrer noopener\" href=\"https:\/\/caniuse.com\/#feat=download\" target=\"_blank\">Browser compatibility<\/a>.<\/td><\/tr><tr><td><a name=\"option-onclick\" href=\"#option-onclick\">onclick<\/a><\/td><td>A custom JavaScript code for the <code>onclick<\/code> HTML attribute. This feature may be disabled on your site. <a href=\"\/docs\/unsafe-features\/\">Learn why<\/a>.<\/td><\/tr><tr><td><a name=\"option-rel\" href=\"#option-rel\">rel<\/a><\/td><td>A custom value for the <code>rel<\/code> HTML attribute.<br><br><strong>Example values:<\/strong> <code>nofollow<\/code>, <code>lightbox<\/code><\/td><\/tr><tr><td><a name=\"option-title\" href=\"#option-title\">title<\/a><\/td><td>A custom value for the <code>title<\/code> HTML attribute.<\/td><\/tr><tr><td><a name=\"option-id\" href=\"#option-id\">id<\/a><\/td><td>A custom value for the <code>id<\/code> HTML attribute.<\/td><\/tr><tr><td><a name=\"option-class\" href=\"#option-class\">class<\/a><\/td><td>Additional CSS class name(s) separated by space(s)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"examples\">Examples<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"button-styles\">Button styles<\/h3>\n\n\n<div class=\"block-demo block-demo-default\">\n\t<div class=\"block-demo-viewport\">\n\t\t<p><a href=\"#\" class=\"su-button su-button-style-default\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Style: Default <\/span><\/a><\/p>\n<p><a href=\"#\" class=\"su-button su-button-style-flat\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:0px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 20px;font-size:16px;line-height:32px;border-color:#6cadf4;border-radius:0px;text-shadow:none\">  Style: Flat <\/span><\/a><\/p>\n<p><a href=\"#\" class=\"su-button su-button-style-ghost\" style=\"color:#2D89EF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#2D89EF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Style: Ghost <\/span><\/a><\/p>\n<p><a href=\"#\" class=\"su-button su-button-style-soft\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Style: Soft <\/span><\/a><\/p>\n<p><a href=\"#\" class=\"su-button su-button-style-glass\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Style: Glass <\/span><\/a><\/p>\n<p><a href=\"#\" class=\"su-button su-button-style-bubbles\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Style: Bubbles <\/span><\/a><\/p>\n<p><a href=\"#\" class=\"su-button su-button-style-noise\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Style: Noise <\/span><\/a><\/p>\n<p><a href=\"#\" class=\"su-button su-button-style-stroked\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Style: Stroked <\/span><\/a><\/p>\n<p><a href=\"#\" class=\"su-button su-button-style-3d\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Style: 3d <\/span><\/a><\/p>\n\t<\/div>\n\t<div class=\"block-demo-source\">\n\t\t<pre contenteditable=\"true\"><a href=\"http:\/\/&quot;#&quot;\" class=\"su-button su-button-style-quotdefaultquot\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Style: Default <\/span><\/a>\n\n<a href=\"http:\/\/&quot;#&quot;\" class=\"su-button su-button-style-quotflatquot\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:0px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 10px;font-size:9px;line-height:18px;border-color:#6cadf4;border-radius:0px;text-shadow:none\">  Style: Flat <\/span><\/a>\n\n<a href=\"http:\/\/&quot;#&quot;\" class=\"su-button su-button-style-quotghostquot\" style=\"color:quot#2D89EFquot;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:quot#2D89EFquot;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Style: Ghost <\/span><\/a>\n\n<a href=\"http:\/\/&quot;#&quot;\" class=\"su-button su-button-style-quotsoftquot\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Style: Soft <\/span><\/a>\n\n<a href=\"http:\/\/&quot;#&quot;\" class=\"su-button su-button-style-quotglassquot\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Style: Glass <\/span><\/a>\n\n<a href=\"http:\/\/&quot;#&quot;\" class=\"su-button su-button-style-quotbubblesquot\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Style: Bubbles <\/span><\/a>\n\n<a href=\"http:\/\/&quot;#&quot;\" class=\"su-button su-button-style-quotnoisequot\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Style: Noise <\/span><\/a>\n\n<a href=\"http:\/\/&quot;#&quot;\" class=\"su-button su-button-style-quotstrokedquot\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Style: Stroked <\/span><\/a>\n\n<a href=\"http:\/\/&quot;#&quot;\" class=\"su-button su-button-style-quot3dquot\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Style: 3d <\/span><\/a><\/pre>\n\t<\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"opening-link-in-a-new-tab\">Opening link in a new tab<\/h3>\n\n\n<div class=\"block-demo block-demo-default\">\n\t<div class=\"block-demo-viewport\">\n\t\t<p><a href=\"https:\/\/wordpress.org\/\" class=\"su-button su-button-style-default\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Open wordpress.org in a new tab <\/span><\/a><\/p>\n\t<\/div>\n\t<div class=\"block-demo-source\">\n\t\t<pre contenteditable=\"true\"><a href=\"\" class=\"su-button su-button-style-default\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_quotblankquot\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Open wordpress.org in a new tab <\/span><\/a><\/pre>\n\t<\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"the-download-option\">The download option<\/h3>\n\n\n\n<p>The following shortcode will display a download link. After clicking this link, the browser should start downloading <em>file.jpg<\/em> with the name <em>My-File.jpg<\/em>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;su_button url=\"https:\/\/example.com\/file.jpg\" download=\"My-File\"] Download &#091;\/su_button]<\/code><\/pre>\n\n\n\n<p>This option may not work in particular browsers and server environments. Make sure your server is sending the correct response headers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"aligning-buttons-horizontally\">Aligning buttons horizontally<\/h3>\n\n\n\n<p>To align a few buttons horizontally, just remove newlines between them:<\/p>\n\n\n<div class=\"block-demo block-demo-default\">\n\t<div class=\"block-demo-viewport\">\n\t\t<p><a href=\"https:\/\/getshortcodes.com\" class=\"su-button su-button-style-default\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Button <\/span><\/a> <a href=\"https:\/\/getshortcodes.com\" class=\"su-button su-button-style-default\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Button <\/span><\/a> <a href=\"https:\/\/getshortcodes.com\" class=\"su-button su-button-style-default\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Button <\/span><\/a><\/p>\n\t<\/div>\n\t<div class=\"block-demo-source\">\n\t\t<pre contenteditable=\"true\"><a href=\"https:\/\/getshortcodes.com\" class=\"su-button su-button-style-default\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Button <\/span><\/a> <a href=\"https:\/\/getshortcodes.com\" class=\"su-button su-button-style-default\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Button <\/span><\/a> <a href=\"https:\/\/getshortcodes.com\" class=\"su-button su-button-style-default\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Button <\/span><\/a><\/pre>\n\t<\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"icons\">Icons<\/h3>\n\n\n<div class=\"block-demo block-demo-default\">\n\t<div class=\"block-demo-viewport\">\n\t\t<p><a href=\"https:\/\/getshortcodes.com\" class=\"su-button su-button-style-default\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:6px 16px;font-size:13px;line-height:20px;border-color:#6cadf4;border-radius:5px;text-shadow:none\"><i class=\"sui sui-star\" style=\"font-size:13px;color:#fffc40\"><\/i>  Button with icon <\/span><\/a><\/p>\n\t<\/div>\n\t<div class=\"block-demo-source\">\n\t\t<pre contenteditable=\"true\"><a href=\"https:\/\/getshortcodes.com\" class=\"su-button su-button-style-default\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:6px 16px;font-size:13px;line-height:20px;border-color:#6cadf4;border-radius:5px;text-shadow:none\"><i class=\"sui sui-quot\" style=\"font-size:13px;color:quot#fffc40quot\"><\/i>  Button with icon <\/span><\/a><\/pre>\n\t<\/div>\n<\/div>\n","protected":false},"featured_media":36644,"template":"","docs_category":[21],"class_list":["post-33937","docs","type-docs","status-publish","has-post-thumbnail","hentry","docs_category-shortcodes"],"_links":{"self":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/docs\/33937","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/types\/docs"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/media\/36644"}],"wp:attachment":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/media?parent=33937"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/docs_category?post=33937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}