Last active
March 30, 2017 20:20
-
-
Save graylaurenm/e188f783b6f1ff34906c34eb2c654359 to your computer and use it in GitHub Desktop.
Automatically Add WP Recipe Maker "Jump" And "Print" Buttons to ALL Posts http://oncecoupled.com/2016/09/auto-jump-print-buttons-wprm/
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 // Do NOT copy this line. :) | |
/** | |
* Automatically insert WPRM buttons | |
* | |
* @author Lauren Gray, Once Coupled | |
* @link https://oncecoupled.com | |
*/ | |
add_action('genesis_entry_content', 'oncecoupled_wprm_buttons', 1); | |
function oncecoupled_wprm_buttons() { | |
if ( is_single() && ( shortcode_exists( 'wprm-recipe-jump' ) || shortcode_exists( 'wprm-recipe-print' ) ) ) { | |
echo '<div class="wprm-buttons">'; | |
if ( shortcode_exists( 'wprm-recipe-jump' ) ) { | |
echo do_shortcode( '[wprm-recipe-jump]' ); | |
} | |
if ( shortcode_exists( 'wprm-recipe-print' ) ) { | |
echo do_shortcode( '[wprm-recipe-print]' ); | |
} | |
echo '</div>'; | |
} | |
} |
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
/* Starter Styling for WPRM Buttons – Once Coupled */ | |
.wprm-buttons { | |
text-align: center; | |
} | |
.wprm-buttons a { | |
display: inline-block; | |
background: #000; | |
color: #fff; | |
padding: 10px 20px; | |
margin: 0 10px 20px; | |
} | |
.wprm-buttons a:hover { | |
background: #555; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment