Skip to content

Instantly share code, notes, and snippets.

View conschneider's full-sized avatar
🐼
Relax. Nothing is under control.

Con Schneider conschneider

🐼
Relax. Nothing is under control.
View GitHub Profile
/**
* wc_shipment_tracking_add_custom_provider
*
* Adds custom provider to shipment tracking
* Change the country name, the provider name, and the URL (it must include the %1$s)
* Add one provider per line
*/
add_filter( 'wc_shipment_tracking_get_providers' , 'wc_shipment_tracking_better_hermes' );
@conschneider
conschneider / css
Created June 16, 2020 13:54 — forked from PadreZippo/embed.html
iframes with constant aspect ratios
.ratio-16-9,
.ratio-16-10,
.ratio-square {
display: block;
position: relative;
width: 100%;
height: 0;
}
.ratio-16-9 {
@conschneider
conschneider / WP OneSignal Push To App.php
Created May 28, 2020 20:06
Sets the URL to app_url so that OneSignal WordPress Push Notifications open the app instead of phone browser. Disables Browser Notifications.
<?php
/*
Plugin Name: WP OneSignal Push To App
Description: Sets the URL to app_url so that OneSignal WordPress Push Notifications open the app instead of phone browser. Disables Browser Notifications.
Version: 1.0
Author: Con & Anna Schneider
Author URI: https://conschneider.de
*/
// If this file is called directly, abort.
@conschneider
conschneider / Statamic: Exclude collection entries by taxonomy tag custom filter.php
Created May 13, 2020 18:03
Filter a collection by taxonomy tag and exclude entries with a specific taxonomy.
<?php
namespace Statamic\Addons\StartTax;
use Statamic\Extend\Filter;
class StartTaxFilter extends Filter
{
/**
* This excludes entries that have a specific tag set. In this case 'Startseite'.
@conschneider
conschneider / function.php
Created May 6, 2020 17:13 — forked from setola/function.php
Wordpress - excerpt with wysiwyg editor
<?php
/**
* This class removes the default excerpt metabox
* and adds a new box with the wysiwyg editor capability
* @author etessore
*/
class TinyMceExcerptCustomization{
const textdomain = '';
const custom_exceprt_slug = '_custom-excerpt';
@conschneider
conschneider / WooCommerce-Bookings-list-person-types.txt
Last active May 4, 2020 07:44
WooCommerce Bookings template for displaying Persons and it's meta info of a booking product
<?php
/*
Template Name: Bookings Person types list
*/
?>
<?php get_header(); ?>
<?php
@conschneider
conschneider / woocommerce-show-notice-when-backorder.php
Last active April 11, 2020 21:02
WooCommerce add notices for when backorders are (not) allowed.
//output with add to cart button on product detail page
add_action( 'woocommerce_after_add_to_cart_form', 'custom_notice_for_backorders_allowed' );
function custom_notice_for_backorders_allowed()
{
//instantinate product object
global $product;
//check if backorders are allowed
if ( $product->backorders_allowed() )
add_filter( 'woocommerce_admin_disabled', '__return_true' );
@conschneider
conschneider / Create WooCommerce Admin tables for WooCommerce 4 manually.sql
Last active March 19, 2020 13:52
This SQL command creates the WooCommerce Admin tables for WooCommerce 4 manually.
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for wp_wc_admin_note_actions
-- INFO: This uses the prefix wp_ - change accordingly.
-- ----------------------------
DROP TABLE IF EXISTS `wp_wc_admin_note_actions`;
CREATE TABLE `wp_wc_admin_note_actions` (
`action_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
.page-template-template-homepage .type-page {padding-top:0;padding-bottom:0;}
.hentry{margin:0;}
.page-template-template-homepage:not(.has-post-thumbnail) .site-main {padding-top:0;}