Skip to content

Instantly share code, notes, and snippets.

View RevConcept's full-sized avatar

Chris RevConcept

View GitHub Profile
/*
Simple Grid
Learn More - http://dallasbass.com/simple-grid-a-lightweight-responsive-css-grid/
Project Page - http://thisisdallas.github.com/Simple-Grid/
Author - Dallas Bass
Site - dallasbass.com
*/
*, *:after, *:before {
-webkit-box-sizing: border-box;
@RevConcept
RevConcept / attachment-cpt.php
Last active August 28, 2015 06:51
Adds thumbnail of attachment to admin columns and image preview to CPT admin post page. CPT in example is 'guest-photos'. Using this in addition to "Frontend Uploader" plugin (https://wordpress.org/plugins/frontend-uploader/)
/* ===========================================
Show Guest Photo Attachment in CPT Admin Columns
=============================================*/
// GET ATTACHED IMAGE
function revcon_get_attachment_image($post_ID) {
$images = get_attached_media('image', $post_ID);
if ($images) {
@RevConcept
RevConcept / functions.php
Last active February 20, 2016 05:35
Page View Cookie
/* ===========================================
Count LC Page Views
=============================================*/
function non_member_view_count() {
if ( !is_user_logged_in() ) {
if ( !isset($_COOKIE['lc_page_view']) ) {
$value = 1;
setcookie('lc_page_view', $value, time()+3600*24*100, '/', 'cardiacmri.com', false);
@RevConcept
RevConcept / mbt_split_nav_walker_with_child_nav.php
Created June 2, 2017 16:47
An improvement on my original gist that splits the WordPress navigation into two menus (for sites with a centered logo for example). This version accounts for sites that are also using dropdown menus. It will only take the top level menu items into account when calculating the breakpoint location.
/* ==========================================================================
Custom Walker: Split menu based on item count
========================================================================== */
class mbt_split_nav_walker extends Walker_Nav_Menu {
var $current_menu = null;
var $break_point = null;