Skip to content

Instantly share code, notes, and snippets.

View frankschrijvers's full-sized avatar

WPStudio frankschrijvers

View GitHub Profile
@frankschrijvers
frankschrijvers / functions.php
Created June 9, 2016 14:28
Process the checkout and set error message
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Process the checkout
add_action('woocommerce_checkout_process', 'wps_select_checkout_field_process');
function wps_select_checkout_field_process() {
global $woocommerce;
// Check if set, if its not set add an error.
if ($_POST['daypart'] == "blank")
@frankschrijvers
frankschrijvers / functions.php
Last active March 16, 2021 18:20
Add a custom select field to the WooCommerce checkout page
<?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(
curl -LO https://github.com/restic/restic/releases/download/v0.9.5/restic_0.9.5_linux_amd64.bz2
.page-contact .site-footer {
background-color: #000;
color: #fff;
}
@frankschrijvers
frankschrijvers / page-slug-body-class.php
Last active June 20, 2019 09:24
Add Page Slug as Body Class
<?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 08:44
Add Payment Method Column to Admin Orders
<?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 February 12, 2019 22:23
Add Email This Option to Bottom of Post
<?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
Created September 19, 2016 08:22
Change add to cart button text archive pages
<?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' );
// Deregister stylesheet Genesis Simple Share
add_action( 'wp_enqueue_scripts', 'wpstudio_deregister_styles' );
function wpstudio_deregister_styles() {
wp_deregister_style( 'genesis-simple-share-plugin-css' );
}
@frankschrijvers
frankschrijvers / widget.txt
Last active August 16, 2017 13:05
Tex twidget Seasons theme
<p><i class="fa fa-shopping-bag" aria-hidden="true"></i></p>
<h3>Sell Your Products</h3>
<p>Start earning money by selling your products with the Seasons theme.</p>
<a href class="button">Buy theme</a>