Skip to content

Instantly share code, notes, and snippets.

View cjwd-snippets's full-sized avatar

cjwd-snippets

View GitHub Profile
@cjwd-snippets
cjwd-snippets / Footer Markup
Last active August 29, 2015 14:21
Dynamically widgetize wordpress footer
<?php
/*
Description: Adds a taxonomy filter in the admin list page for a custom post type.
Written for: http://wordpress.stackexchange.com/posts/582/
By: Mike Schinkel - http://mikeschinkel.com/custom-workpress-plugins
Instructions: Put this code in your theme's functions.php file or inside your own plugin. Edit to suite your post types and taxonomies. Hope this helps...
*/
add_filter('manage_listing_posts_columns', 'add_businesses_column_to_listing_list');
function add_businesses_column_to_listing_list( $posts_columns ) {
if (!isset($posts_columns['author'])) {
@cjwd-snippets
cjwd-snippets / main.scss
Last active October 28, 2017 22:33
Main stylesheet starter
/* ==========================================================================
INUITCSS
========================================================================== */
/**
* inuitcss, by @csswizardry
*
* github.com/inuitcss | inuitcss.com
*/
///*------------------------------------*\
// #MIXINS
//\*------------------------------------*/
// Spit out vendor prefixes in one go. Very pragmatic, far from perfect.
@mixin vendor($property, $value...) {
-webkit-#{$property}: $value;
-moz-#{$property}: $value;
#{$property}: $value;
}
///*------------------------------------*\
// #GLOBAL
//\*------------------------------------*/
$brand-color: #000000;
$brand-round: 3px;
$base-round: $brand-round;
///*------------------------------------*\
// #COLORS
//\*------------------------------------*/
$color-brand: $brand-color;
$color-pink: $color-brand;
$color-gray: #333;
$color-gray-light: #999;
$color-gray-ui: #ddd;
$color-green: #859900;
/*------------------------------------*\
#SHOW-HIDE
\*------------------------------------*/
.hide, .screen-reader-text { @include hide(); }
@include media-query(palm) {
.hide-palm { @include hide(); }
}
@cjwd-snippets
cjwd-snippets / class-pluginname-loader
Created July 31, 2016 17:01
Register all actions,filters and shortcodes for the plugin
<?php
/**
* Register all actions and filters for the plugin
*
* @link http://chinarajames.com
* @since 1.0.0
*
* @package Studiousapp_Notes
* @subpackage Studiousapp_Notes/includes
@cjwd-snippets
cjwd-snippets / redirect-to-custom-login-page
Created September 20, 2016 17:04
Redirects wp-login.php to custom login page
add_action('init', 'studious_redirect_to_custom_login');
function studious_redirect_to_custom_login() {
$login_page = home_url('/login/');
$page = basename($_SERVER['REQUEST_URI']);
if( $page == "wp-login.php" && $_SERVER['REQUEST_METHOD'] == 'GET') {
wp_redirect($login_page);
exit;
}
}
@cjwd-snippets
cjwd-snippets / extras.php
Last active December 13, 2016 21:47
Function to print sage's main and base templates
<?php
use Vault\Sage\Wrapper;
function sage_wrap_info() {
$format = '<h6>The %s template being used is: %s</h6>';
$main = Wrapper\SpringWrapping::$main_template;
global $template;
printf($format, 'Main', $main);