Skip to content

Instantly share code, notes, and snippets.

@texe
texe / functions.php
Last active July 7, 2022 12:22
WordPress - Remove SKU in WooCommerce
// remove SKU in WooCommerce
function ct_remove_product_sku($enabled) {
if (! is_admin() && is_product()) {
return false;
}
return $enabled;
}
add_filter( 'wc_product_sku_enabled', 'ct_remove_product_sku' );
@texe
texe / functions.php
Last active July 7, 2022 12:22
WordPress - How to remove additional information tab in WooCommerce
// Remove additional information tab
function remove_product_tabs($tabs) {
unset($tabs['additional_information']);
return $tabs;
}
add_filter('woocommerce_product_tabs', 'remove_product_tabs',98);
@texe
texe / dropcap.css
Created June 6, 2022 11:56
How to make a dropcap in CSS
h1 {
font-size: 45px;
}
h1::first-letter {
color:#ffbb00;
font-size: 95px;
}
p::first-letter {
@texe
texe / functions.php
Created June 3, 2022 13:46
WordPress shortcode
function my_shortcode() {
$message = 'This is message from my shortcode!';
return $message;
}
add_shortcode('my_heading', 'my_shortcode');
@texe
texe / gradient-title.css
Created May 6, 2022 10:09
Gradient title in CSS
.gradient {
background-image: linear-gradient(to right, #FF4365, #e6a612, #f8030c);
background-clip: text;
color: transparent;
font-size: 75px;
font-weight:bold;
}
@texe
texe / docerfile
Created November 22, 2021 15:46
Nginx and PHP in Docker
# Set master image
FROM php:7.4-fpm-alpine
# Set working directory
WORKDIR /var/www/html
# Install Additional dependencies
RUN apk update && apk add --no-cache \
build-base shadow vim curl \
php7 \
@texe
texe / functions.php
Created November 20, 2021 04:46
Gist for Wordpress
/**
* Embed Gists with a URL
*
* Usage:
* Paste a gist link into a blog post or page and it will be embedded eg:
* https://gist.github.com/2926827
*
* If a gist has multiple files you can select one using a url in the following format:
* https://gist.github.com/2926827?file=embed-gist.php
*
@texe
texe / install-docker.sh
Last active November 19, 2021 17:58
Script for installing Docker and docker-compose in Linux Mint/Ubuntu
#!/bin/bash
sudo apt-get update
# install dependencies
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
# add the gpg key for docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -