Created
March 25, 2012 22:14
-
-
Save ebinnion/2200334 to your computer and use it in GitHub Desktop.
Thesis Shortcodes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function pRecommended() { | |
return '<p class="recommended"><a class="button" href="http://www.wpengine.com">View Pricing for WP Engine →</a>'; | |
} | |
add_shortcode('recommended', 'pRecommended'); | |
?> | |
// [recommended] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p.recommended{ | |
padding: 1em; | |
background: url(http://wpenginereview.com/wp-content/uploads/2012/03/feature-backup.png) no-repeat 600px center #f5f5f5; | |
border: 5px solid #EBEBEB; | |
font-size: 18px; | |
} | |
p.recommended .button { | |
margin-left: 320px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? php | |
function sButton($atts, $content = null) { | |
extract(shortcode_atts(array('link' => '#'), $atts)); | |
return '<a class="button" href="'.$link.'"><span>' . do_shortcode($content) . '</span></a>'; | |
} | |
add_shortcode('button', 'sButton'); | |
[button link="#"]Go to Google[/button] | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment