Skip to content

Instantly share code, notes, and snippets.

@davidkryzaniak
Created November 8, 2013 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidkryzaniak/7366258 to your computer and use it in GitHub Desktop.
Save davidkryzaniak/7366258 to your computer and use it in GitHub Desktop.
a.fancy-button:visited,
a.fancy-button{
color: #FFF;background-color: #5CB85C;text-decoration: none;
border-color: #4CAE4C;display: inline-block;padding: 6px 12px;margin-bottom: 0;
font-size: 14px;font-weight: normal;line-height: 1.428571429;text-align: center;
white-space: nowrap;vertical-align: middle;cursor: pointer;background-image: none;
border: 1px solid rgba(0, 0, 0, 0);border-radius: 4px;-webkit-user-select: none;
-moz-user-select: none;-ms-user-select: none;-o-user-select: none;user-select: none;
}
a.fancy-button:hover{
background-color: #448744;
}
p.text-center{text-align: center}
<?php
/*
* Plugin Name: WP Appleton Call to Action Buttons
* Author: David Kryzaniak
*/
//Tell WP we'd like to add a shortcode
add_shortcode(
'calltoaction', //Name of the shortcode [calltoaction]
'getCallToActionButton' //The function that "makes" the shortcode
);
function getCallToActionButton($atts,$content='Default'){
$atts = shortcode_atts(
array(
'url'=>'/', //set the default href url
'rel'=>'' //set the rel (for rel="nofollow")
),
$atts
);
wp_enqueue_style(
'CallToActionStyles',
plugins_url( '/CallToAction.css', __FILE__ )
); //enqueue a style sheet
return '<p class="text-center">'. //make them centered
'<a class="fancy-button" rel="'.$atts['rel'].'" href="'.$atts['url'].'">'.$content.'</a>'.
'</p>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment