Skip to content

Instantly share code, notes, and snippets.

WPStudio frankschrijvers

Block or report user

Report or block frankschrijvers

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View install-restic.txt
curl -LO https://github.com/restic/restic/releases/download/v0.9.5/restic_0.9.5_linux_amd64.bz2
@frankschrijvers
frankschrijvers / functions.php
Last active Jun 24, 2019
Add gallery thumbs to woocommerce shop page
View functions.php
//* 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();
View contact-page.css
.page-contact .site-footer {
background-color: #000;
color: #fff;
}
@frankschrijvers
frankschrijvers / page-slug-body-class.php
Last active Jun 20, 2019
Add Page Slug as Body Class
View page-slug-body-class.php
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
add_filter( 'body_class', 'wps_add_slug_body_class' );
/**
* Add Page Slug as Body Class.
*/
function wps_add_slug_body_class( $classes ) {
global $post;
@frankschrijvers
frankschrijvers / woocommerce-show-payment-method.php
Created May 7, 2019
Add Payment Method Column to Admin Orders
View woocommerce-show-payment-method.php
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
add_filter( 'manage_edit-shop_order_columns', 'wps_add_payment_method_column', 20 );
/**
* Add payment method column
*/
function wps_add_payment_method_column( $columns ) {
$new_columns = array();
@frankschrijvers
frankschrijvers / functions.php
Last active Apr 29, 2019
Hide other shipping methods when FREE SHIPPING is available
View functions.php
**
* woocommerce_package_rates is a 2.1+ hook
*/
add_filter( 'woocommerce_package_rates', 'hide_shipping_when_free_is_available', 10, 2 );
/**
* Hide shipping rates when free shipping is available
*
* @param array $rates Array of rates found for the package
* @param array $package The package array/object being shipped
@frankschrijvers
frankschrijvers / functions.php
Last active Feb 12, 2019
Add a custom select field to the WooCommerce checkout page
View functions.php
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Add select field to the checkout page
add_action('woocommerce_before_order_notes', 'wps_add_select_checkout_field');
function wps_add_select_checkout_field( $checkout ) {
echo '<h2>'.__('Next Day Delivery').'</h2>';
woocommerce_form_field( 'daypart', array(
@frankschrijvers
frankschrijvers / functions.php
Last active Feb 12, 2019
Add Email This Option to Bottom of Post
View functions.php
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Add Email This Option to Bottom of Post
add_filter( 'the_content', 'wps_add_email_this_button' );
function wps_add_email_this_button($content){
if (is_single()) {
$content .= '<a class="mail-btn" href="mailto:?subject=' . get_the_title() . '&amp;body=' . get_the_permalink() . '" title="Send this article to a friend!">Email this</a>';
@frankschrijvers
frankschrijvers / functions.php
Last active Feb 12, 2019
Change add to cart button text
View functions.php
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Change add to cart button text single product page
add_filter( 'woocommerce_product_single_add_to_cart_text', 'wps_custom_cart_button_text' );
function wps_custom_cart_button_text() {
return __( 'Buy Product', 'your_theme_text_domain' );
@frankschrijvers
frankschrijvers / functions.php
Created Sep 19, 2016
Change add to cart button text archive pages
View functions.php
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Change add to cart button text archive pages
add_filter( 'woocommerce_product_add_to_cart_text', 'wps_archive_custom_cart_button_text' );
function wps_archive_custom_cart_button_text() {
return __( 'Buy Product', 'your_theme_text_domain' );
You can’t perform that action at this time.