download button shortcode in wordpress

Add code to function.php

function download($atts, $content = null) {
	extract(shortcode_atts(array(
		"url" => ''
	), $atts));
	return '<a href="'.$url.'" class="download">'.$content.'</a>';
}
add_shortcode('download', 'download');

add code to style.css

.download {display: inline-block;color:#fff;font-weight:bold;font-size:1.2em;
background : -webkit-gradient(linear, left top, left bottom, from(#88c841), to(#73b338));
background : -moz-linear-gradient(center top, #88c841, #73b338);
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
padding: 5px 20px;
text-align: center;
-shadow: 0px 1px 0px #6c0909;
}

.download:hover {
background : -webkit-gradient(linear, left top, left bottom, from(#73b338), to(#88c841));
background : -moz-linear-gradient(center top, #73b338, #88c841);
}

usage:

[download url="http://www.google.com"]Download Google Chrome[/download]

Geplaatst

in

door

Tags:

Reacties

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *