This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.gradient { | |
background-image: linear-gradient(to right, #FF4365, #e6a612, #f8030c); | |
background-clip: text; | |
color: transparent; | |
font-size: 75px; | |
font-weight:bold; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_shortcode() { | |
$message = 'This is message from my shortcode!'; | |
return $message; | |
} | |
add_shortcode('my_heading', 'my_shortcode'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h1 { | |
font-size: 45px; | |
} | |
h1::first-letter { | |
color:#ffbb00; | |
font-size: 95px; | |
} | |
p::first-letter { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove additional information tab | |
function remove_product_tabs($tabs) { | |
unset($tabs['additional_information']); | |
return $tabs; | |
} | |
add_filter('woocommerce_product_tabs', 'remove_product_tabs',98); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// redirect to home after login/logout | |
add_action('wp_logout','go_home'); | |
function go_home(){ | |
wp_redirect( home_url() ); | |
exit(); | |
} | |
add_action('wp_login','go_home_after_login'); | |
function go_home_after_login(){ | |
wp_redirect( home_url() ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// shortcode for Login/register vs Logout | |
function md_login_logout() { | |
if ( is_user_logged_in()) { | |
$link = '<a href="' . wp_logout_url() . '">Logout</a>'; | |
} | |
if ( !is_user_logged_in()) { | |
$link = '<a href="/my-account/edit-account/">Login/Register</a>'; | |
} | |
return $link; | |
} |
OlderNewer