Skip to content

Instantly share code, notes, and snippets.

@r4hulp r4hulp/wp.css
Last active Dec 11, 2018

Embed
What would you like to do?
WP Shortcodes
.button_style{
display: inline-block;
font-size: 11px;
height: 19px;
margin: 5px 10px 5px 10px;
padding: 9px 13px 0;
text-decoration: none !important;
color:#fff !important;
line-height:11px;
background: #59595a;
border-radius: 3px;
border:1px solid #23282F;
}
/* You can add other sub classes such as small, very large as well. */
.button_style.large{
font-size: 14px;
height: 24px;
line-height: 14px;
padding: 11px 10px 0;
background-position:0 -28px;
}
.button_style{
text-shadow:0 1px 0 rgba(0, 0, 0, 0.4) !important;
-webkit-transition:all 0.3s ease-in;
-moz-transition:all 0.3s ease-in;
-o-transition:all 0.3s ease-in;
transition:all 0.3s ease-in;
}
.button_style:hover{
text-decoration:none !important;
opacity:0.8;
}
.blue{
background: #0276c1 !important;
color:#fff !important;
text-shadow:0 -1px 0 #888 !important;
border:1px solid #005c97 !important;
}
.green{
background: #8ebd40 !important;
color:#fff !important;
text-shadow:0 -1px 0 #888 !important;
border:1px solid #7ca932 !important;
}
[button link=" <link here> " target= " " theme = " theme class name" align = " Left or right" size = "button size"] Button Name [/button]
function button( $atts, $content = null ) {
extract(shortcode_atts(array(
'link' => '#',
'target' => '',
'theme' => '',
'size' => '',
'align' => '',
), $atts));
$style = ($theme) ? ' '.$theme: '';
$align = ($align) ? ' align'.$align : '';
$size = ($size == 'large') ? ' large_button' : '';
$target = ($target == 'blank') ? ' target="_blank"' : '';
$out = '<a' .$target. ' href="' .$link. '">' .do_shortcode($content). '</a>';
return $out;
}
add_shortcode('button', 'button');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.