Skip to content

Instantly share code, notes, and snippets.

View NorthTexasCreative's full-sized avatar

Carla Chalmers NorthTexasCreative

  • North Texas Creative, LLC
  • Stephenville, TX
View GitHub Profile
/************ Name Shortcode *********/
function name_shortcode() {
if ( ! function_exists( 'get_field' ) ) {
return;
} ?>
<?php if ( get_field( 'first_name' ) ): ?>
<?php the_field( 'first_name' ); ?><span> </span><?php the_field( 'last_name' ); ?><?php if(has_term((array('partners','associates','counsel','founding-partner-retired','judiciary','of-counsel')), 'attorney-group')): ?><span>, ESQ.</span >
<?php endif; ?>
<?php endif; ?>
<?php }
SELECT CONCAT( 'ALTER TABLE ', TABLE_NAME, ' ENGINE=InnoDB;' )
FROM INFORMATION_SCHEMA.TABLES
WHERE ENGINE = 'MyISAM'
AND table_schema = 'database-name-here';
@jan-koch
jan-koch / remove-woo-scripts.php
Created February 28, 2020 09:14
Remove WooCommerce related resources except on WooCommerce-based pages (products, cart, checkout, etc). Use on a testing environment before pasting this into your live website!
/**
* This code snippet removes JavaScript and CSS files loaded from WooCommerce if they are not necessary.
*
* Please test this on a staging copy of your website before putting this into the functions.php of your live website.
*/
add_action( 'wp_enqueue_scripts', 'my_remove_woo_assets', 99 );
function my_remove_woo_assets() {
if ( function_exists( 'is_woocommerce' ) ) { // Check if Woo is installed.
if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) { // Only run on non-Woo pages.
// Remove unnecessary stylesheets.
@NorthTexasCreative
NorthTexasCreative / WP CLI.txt
Last active January 28, 2020 21:53
WP CLI Commands
** Install WP CLI on Windows
curl -L -O https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && echo @ECHO OFF > wp.bat && echo php "%~dp0wp-cli.phar" %* >> wp.bat
**Install WP CLI on Server
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
** Test Install
php wp-cli.phar --info
wp --info
@NorthTexasCreative
NorthTexasCreative / k8s-dashboard-secret-retrieval.txt
Created January 26, 2019 01:18
Kubernetes Dashboard Secret Retrieval
kubectl -n kube-system get secret |grep kubernetes-dashboard-token |cut -f1 -d ' ' | xargs kubectl -n kube-system describe secret