graylaurenm
9/22/2016 - 12:48 AM

Automatically Add WP Recipe Maker "Jump" And "Print" Buttons to ALL Posts http://oncecoupled.com/2016/09/auto-jump-print-buttons-wprm/

Automatically Add WP Recipe Maker "Jump" And "Print" Buttons to ALL Posts http://oncecoupled.com/2016/09/auto-jump-print-buttons-wprm/

/* 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;
}
<?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>';
	}
}