Skip to content

Instantly share code, notes, and snippets.

View frankschrijvers's full-sized avatar

WPStudio frankschrijvers

View GitHub Profile
@frankschrijvers
frankschrijvers / functions.php
Last active June 6, 2016 12:23
Modify the Genesis read more link
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Modify the Genesis read more link
add_filter( 'excerpt_more', 'wps_read_more_link');
add_filter('get_the_content_more_link', 'wps_read_more_link');
function wps_read_more_link() {
return '... <a class="more-link" href="' . get_permalink() . '">Continue Reading<span class="screen-reader-text">' . get_the_title() . '</span></a>';
@frankschrijvers
frankschrijvers / index.html
Created May 19, 2016 11:05
HTML markup buttons
<a href="http://google.com" class="button">Primary button</a>
<a href="http://google.com" class="button-dark">Dark button</a>
<a href="http://google.com" class="button-light">Light button</a>
@frankschrijvers
frankschrijvers / text.txt
Created May 19, 2016 11:03
Shortcode light button
[btn-light link="http://google.com"]Light button[/btn-light]
@frankschrijvers
frankschrijvers / text.txt
Created May 19, 2016 11:02
Shortcode dark button
[btn-dark link="http://google.com"]Dark button[/btn-dark]
@frankschrijvers
frankschrijvers / text.txt
Created May 19, 2016 11:01
Shortcode for primary button
[btn link="http://google.com"]Primary button[/btn]
@frankschrijvers
frankschrijvers / style.css
Created May 13, 2016 11:08
Styling Product thumbnails shop page
/* Product thumbnails shop page
--------------------------------------------- */
.product-thumbs {
display: block;
overflow: auto;
margin: 10px 0;
width :100%;
}
.product-thumbs .thumb {
@frankschrijvers
frankschrijvers / functions.php
Last active July 17, 2021 04:06
Add gallery thumbs to woocommerce shop page
//* Add gallery thumbs to woocommerce shop page
add_action('woocommerce_shop_loop_item_title','wps_add_extra_product_thumbs', 5);
function wps_add_extra_product_thumbs() {
if ( is_shop() ) {
global $product;
$attachment_ids = $product->get_gallery_attachment_ids();
@frankschrijvers
frankschrijvers / functions.php
Created April 25, 2016 10:51
Add Pinterest pin-it button to woocommerve single product page
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Add Pinterest pin-it button to woocommerve single product page
add_action('woocommerce_share', 'wps_pinterest_share' );
function wps_pinterest_share(){
global $post;
$pinterestimage = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
$pinterestbutton = '//assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png';
@frankschrijvers
frankschrijvers / functions.php
Last active April 25, 2016 10:32
Add Pinterest pin-it button to Woocommerce single product page
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Add Pinterest pin-it button to Woocommerce single product page
add_action('woocommerce_share', 'wps_pinterest_share' );
function wps_pinterest_share(){
global $post;
$pinterestimage = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
@frankschrijvers
frankschrijvers / functions.php
Created April 25, 2016 10:11
Loads Pinterest pin-it script
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Loads Pinterest pin-it script
add_action( 'wp_enqueue_scripts', 'wps_load_scripts' );
function wps_load_scripts() {
if ( is_product() ) {
wp_enqueue_script( 'pin-it', '//assets.pinterest.com/js/pinit.js', array('jquery'), null );
}