Skip to content

Instantly share code, notes, and snippets.

View graylaurenm's full-sized avatar

Lauren Gray graylaurenm

View GitHub Profile
<?php // don't include this line
/**
* Customize the credits.
* @since 1.0.0
*/
add_filter( 'genesis_footer_creds_text', 'customgenesis_footer_copyright' );
function customgenesis_footer_copyright() {
$creds = '[footer_copyright before="Copyright" after=" "]' . get_bloginfo ( 'name' );
return $creds;
@graylaurenm
graylaurenm / jump-to-recipe.js
Created October 10, 2016 11:40
Jump and Print buttons for Meal Planner Pro
(function($) {
$(function() {
var jumpID = $( '.mpprecipe-container-border' ).attr( 'id' );
var printID = $( '.butn-link.mpp-button' ).attr( 'onclick' );
var printIDEscaped = htmlEscape(printID);
if( jumpID ) {
if( printID ) { // if jump AND print
$( '.content .entry-header' ).append( '<div class="recipe-buttons"><a class="added-button jump" href="#' + jumpID + '">Jump to Recipe <i class="fa fa-book" aria-hidden="true"></i></a><a class="added-button print" title="Print this recipe" onclick="' + printIDEscaped + '">Print Recipe <i class="fa fa-print" aria-hidden="true"></i></a></div>' );
} else { // if JUST jump
@graylaurenm
graylaurenm / functions.php
Last active March 30, 2017 20:20
Automatically Add WP Recipe Maker "Jump" And "Print" Buttons to ALL Posts http://oncecoupled.com/2016/09/auto-jump-print-buttons-wprm/
<?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() {
@graylaurenm
graylaurenm / functions.php
Last active September 22, 2016 00:45
Two Ways to Ensure the WordPress “Read More” Button Links to the Top of Your Post http://oncecoupled.com/2016/09/wordpress-read-more-top-of-post/
<?php // Don't paste this opening line!
function remove_more_link_scroll( $link ) {
$link = preg_replace( '|#more-[0-9]+|', '', $link );
return $link;
}
add_filter( 'the_content_more_link', 'remove_more_link_scroll' );
@graylaurenm
graylaurenm / genesis-header-scripts.html
Last active March 6, 2017 01:28
Zip Recipes "jump to recipe" starter
<script type="text/javascript">
(function($) {
$(function() {
var jumpID = $( '.zlrecipe-container-border' ).attr( 'id' );
if( jumpID ) {
$( 'body' ).addClass( 'skipLink' );
$( '.content .entry-header' ).append( '<a href="#' + jumpID + '" class="skip">Skip to Recipe</a>' );
}
});
})(jQuery);
@graylaurenm
graylaurenm / functions.php
Last active May 14, 2018 21:15
Genesis infinite scroll, supporting column classes, custom settings by page, and both auto + button loading
<?php
/**
*
* Infinite Scroll
*
* @since 1.0.0
*
* @author Lauren Gray
* @author Bill Erickson
@graylaurenm
graylaurenm / genesis-header-scripts.html
Last active March 6, 2017 01:28
WP Ultimate Recipe "jump to recipe" starter
<script type="text/javascript">
(function($) {
$(function() {
var jumpID = $( '.wpurp-container' ).attr( 'id' );
if( jumpID ) {
$( 'body' ).addClass( 'skipLink' );
$( '.content .entry-header' ).append( '<a href="#' + jumpID + '" class="skip">Skip to Recipe</a>' );
}
});
})(jQuery);
@graylaurenm
graylaurenm / genesis-header-scripts.html
Last active March 6, 2017 01:28
Meal Planner Pro "jump to recipe" starter
<script type="text/javascript">
(function($) {
$(function() {
var jumpID = $( '.mpprecipe-container-border' ).attr( 'id' );
if( jumpID ) {
$( 'body' ).addClass( 'skipLink' );
$( '.content .entry-header' ).append( '<a href="#' + jumpID + '" class="skip">Skip to Recipe</a>' );
}
});
})(jQuery);
<div class="subscription-type" style="display: none;">
<input type="checkbox" checked="checked" value="1" name="group[6277][1]" id="mce-group[6277]-6277-0">
<label for="mce-group[6277]-6277-0">Daily Posts</label>
</div>
@graylaurenm
graylaurenm / genesis-header-scripts.html
Last active March 6, 2017 01:28
EasyRecipe "jump to recipe" starter
<script type="text/javascript">
(function($) {
$(function() {
var jumpID = $( '.easyrecipe' ).attr( 'id' );
if( jumpID ) {
$( 'body' ).addClass( 'skipLink' );
$( '.content .entry-header' ).append( '<a href="#' + jumpID + '" class="skip">Skip to Recipe</a>' );
}
});
})(jQuery);