Skip to content

Instantly share code, notes, and snippets.

View macbookandrew's full-sized avatar

Andrew Minion macbookandrew

View GitHub Profile
@macbookandrew
macbookandrew / church-pack.css
Last active August 29, 2015 14:05
WP for Church - Church Pack Pro Events - show six months at a time
/* add this below line 146 */
#church-pack .calentries {
margin-bottom: 60px;
}
@macbookandrew
macbookandrew / functions.php
Last active August 29, 2015 14:06
WordPress—deregister built-in webfonts
// deregister Bitter and Open Sans webfonts only
function deregister_default_fonts() {
wp_deregister_style( 'twentythirteen-fonts' );
}
add_action( 'wp_enqueue_scripts', 'deregister_default_fonts', 100 );
// remove default fonts, add custom fonts, and use a custom minified stylesheet and register but don’t enqueue style.css with all the theme information
function add_custom_css() {
wp_enqueue_style( 'theme-style', get_stylesheet_directory_uri() . '/style.min.css' );
wp_dequeue_style( 'twentythirteen-style' );
@macbookandrew
macbookandrew / functions.php
Created October 2, 2014 20:48
point search engines from dev to live WordPress site via rel="canonical"
/*
* Dev site: point search engines at live site
*/
// set subdomain
$subdomain = 'dev';
// test whether or not this is a dev site
if ( strpos( get_site_url(), $subdomain . '.' ) !== false ) {
remove_action( 'wp_head', 'rel_canonical' );
@macbookandrew
macbookandrew / deploy.sh
Last active August 29, 2015 14:07 — forked from kloon/deploy.sh
WordPress Plugin deploy script - fixes for hard drives with a space in the name
#! /bin/bash
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
# main config
PLUGINSLUG="plugin-slug"
CURRENTDIR=`pwd`
MAINFILE="main-file.php" # this should be the name of your main php file in the wordpress plugin
# git config
@macbookandrew
macbookandrew / style.scss
Created April 3, 2015 18:25
amr calendar events list - responsive
.largecalendar caption {
font-size: 28px;
text-align: center;
}
#calprop0 {
display: none;
}
.calendar_navigation input {
@macbookandrew
macbookandrew / disable-password-autocomplete.php
Created June 19, 2015 13:24
Wordpress - disable login password autocomplete (PCI compliance)
<?php
/**
* Plugin Name: Disable login autocomplete
* Description: Disable login password autocomplete
* Version: 1.0
* Author: Benjamin Uzelac
* Author URI: https://buzelac.com
* License: WTFPL
*/
@macbookandrew
macbookandrew / language-codes.csv
Last active August 29, 2015 14:23
Language Codes
code country
af Afrikaans
am Amharic
ar-sa Arabic (Saudi Arabia)
as Assamese
az-Latn Azerbaijani (Latin)
be Belarusian
bg Bulgarian
bn-BD Bangla (Bangladesh)
bn-IN Bangla (India)
# Generate Private Key
openssl genrsa -out server.key 4096
# Generate CSR
openssl req -new -out server.csr -key server.key -config openssl.cnf
# => Fill in info
# Check CSR
openssl req -text -noout -in server.csr
# Sign Cert
openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt -extensions v3_req -extfile openssl.cnf
@macbookandrew
macbookandrew / functions.php
Last active November 19, 2015 16:05
Remove all custom header output from 2013 WordPress theme
function remove_custom_header() {
remove_theme_support( 'custom-header' );
}
// the number 12 is key here - the custom header is added with priority 11, so this has to fire after that function in order to remove it
add_action( 'after_setup_theme', 'remove_custom_header', 12 );
@macbookandrew
macbookandrew / quote-images.php
Last active May 27, 2016 18:14
WP plugin to show a single random quote image
<?php
/*
* Plugin Name: Quote Images
* Plugin URI: https://gist.github.com/macbookandrew/7172aef947803f1ac439a352548f382f
* Description: Quote images with shortcode for random display
* Version: 1.0.0
* Author: AndrewRMinion Design
* Author URI: https://andrewrminion.com
*/