Skip to content

Instantly share code, notes, and snippets.

View frankschrijvers's full-sized avatar

WPStudio frankschrijvers

View GitHub Profile
jQuery(function( $ ){
$(".site-header").backstretch([BackStretchImg.src],{duration:3000,fade:750});
});
@frankschrijvers
frankschrijvers / functions.php
Created March 21, 2015 14:48
Add extra class to HTML elements in Genesis
// Add extra class to content
function wpstudio_add_class( $attributes ) {
$attributes['class'] = $attributes['class']. 'your_extra_class';
return $attributes;
}
add_filter( 'genesis_attr_content', 'wpstudio_add_class' );
@frankschrijvers
frankschrijvers / functions.php
Created March 26, 2015 09:10
Replace PayPal logo WooCommerce
//Custom icon for PayPal payment option on WooCommerce checkout page.
function wpstudio_extended_paypal_icon() {
// picture of accepted credit card icons for PayPal payments
return get_stylesheet_directory_uri() .'/images/paypal.png';
}
add_filter( 'woocommerce_paypal_icon', 'wpstudio_extended_paypal_icon' );
@frankschrijvers
frankschrijvers / masonry-scroll.php
Last active August 29, 2015 14:18
Masonry with Infinite scroll Genesis
<?php
/*
Template Name: Masonry Grid Scroll
*/
/*
* @author Frank Schrijvers
* @link https://www.wpstud.io
*/
@frankschrijvers
frankschrijvers / masonry-scroll.php
Last active August 29, 2015 14:18
Masonry with Infine scroll page template
<?php
/*
Template Name: Masonry Grid Scroll
*/
/*
* @author Frank Schrijvers
* @link https://www.wpstud.io
*/
@frankschrijvers
frankschrijvers / init-masonry.js
Created March 31, 2015 10:31
Settings Masonry
// Settings Masonary
jQuery( document ).ready( function( $ ) {
$( '#container' ).masonry( );
} );
@frankschrijvers
frankschrijvers / masonry-scroll.php
Last active August 29, 2015 14:18
Custom loop for masonry page layout
// Masonry loop
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'wpstudio_content_area', 'wpstudio_masonry', 30 );
function wpstudio_masonry() {
$paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
$args = ( array(
'post_type' => 'post',
@frankschrijvers
frankschrijvers / masonry-scroll.php
Last active August 29, 2015 14:18
Add init infinite scroll
// Add init infinite scroll
add_action( 'wp_footer', 'custom_infinite_scroll_js',100);
function custom_infinite_scroll_js() {
?>
<script>
var infinite_scroll = {
loading: {
msgText: "<?php _e( 'Loading the next set of posts...', 'plastic' ); ?>",
finishedMsg: "<?php _e( 'All posts loaded.', 'plastic' ); ?>"
},
// Build the page
get_header();
do_action( 'wpstudio_content_area' );
get_footer();
@frankschrijvers
frankschrijvers / style.css
Last active August 29, 2015 14:18
Masonry CSS
/* Masonry & Infinite scroll
--------------------------------------------- */
#container {
margin-bottom: -1.875em;
margin-left: -1.562%;
overflow: hidden;
padding-bottom: 160px;
position: relative;
width: 103.125%;
}