Skip to content

Instantly share code, notes, and snippets.

View eartisan-uk's full-sized avatar

eArtisan eartisan-uk

View GitHub Profile
@mrl22
mrl22 / README.md
Last active March 14, 2024 14:32
PHP 8.1 Support for Apache and NGINX (OpenResty) on Moss.sh

Do not copy and paste this code, it requires changes

Other PHP versions available here: https://gist.github.com/search?q=user%3Amrl22+moss

As of writing this, Moss.sh does not support PHP 8.1 via the control panel even though Ubuntu does.

Set up your website using Moss.sh and select Apache with PHP 7.4.

Once complete, we need to install PHP 8.1 with all the packages moss installs for 7.4.

@kennyeliason
kennyeliason / makewpsuck.sh
Last active May 2, 2024 07:30
Make WP Suck Less or More
#!/bin/bash
# Make sites into bedrock or normal WordPress
# Version 2.0
# Copyright (c) Kenny Eliason
set -a
source .env
set +a
@maddisondesigns
maddisondesigns / functions.php
Last active February 7, 2024 13:42
WooCommerce Custom Fields for Simple & Variable Products
/*
* Add our Custom Fields to simple products
*/
function mytheme_woo_add_custom_fields() {
global $woocommerce, $post;
echo '<div class="options_group">';
// Text Field
@Nikschavan
Nikschavan / woocommerce-remove-uncategorized-from-breadcrumb.php
Last active August 3, 2023 09:14
Remove Untitled category from the breadcrumb.
<?php // don't copy this line in your code.
/**
* Remove uncategorized from the WooCommerce breadcrumb.
*
* @param Array $crumbs Breadcrumb crumbs for WooCommerce breadcrumb.
* @return Array WooCommerce Breadcrumb crumbs with default category removed.
*/
function your_prefix_wc_remove_uncategorized_from_breadcrumb( $crumbs ) {
$category = get_option( 'default_product_cat' );
$caregory_link = get_category_link( $category );
@nicomollet
nicomollet / polylang-langswitcher-shortcode.php
Last active January 17, 2024 11:25
Polylang shortcode for lang switcher
<?php
/**
* Polylang Shortcode - https://wordpress.org/plugins/polylang/
* Add this code in your functions.php
* Put shortcode [polylang_langswitcher] to post/page for display flags
*
* @return string
*/
function custom_polylang_langswitcher() {
$output = '';