Skip to content

Instantly share code, notes, and snippets.

View RevConcept's full-sized avatar

Chris RevConcept

View GitHub Profile
@RevConcept
RevConcept / mbt_split_nav_walker.php
Last active February 5, 2021 01:01
WordPress Custom Walker: Split menu based on item count
/* ==========================================================================
Custom Walker Menu
========================================================================== */
class mbt_split_nav_walker extends Walker_Nav_Menu {
var $current_menu = null;
var $break_point = null;
function start_el(&$output, $item, $depth, $args) {
@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;
@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 / CSS
Last active December 26, 2015 08:39
The remaining elements for Isotope filters you will need
/**** Isotope Filtering ****/
.isotope-item {
z-index: 2;
}
.isotope-hidden.isotope-item {
pointer-events: none;
z-index: 1;
}
@RevConcept
RevConcept / functions.php
Last active December 24, 2015 10:09
Example of the functionality plugin and the functions.php file used for the RSG website.
<?php
/* ==========================================================================
Load jQuery
========================================================================== */
// NOTE: Deregisters the native install of jQuery and loads a specific version from Google.
if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);
@RevConcept
RevConcept / post-attachment-slider-lightbox
Created September 16, 2013 01:50
Modifications to include a lightbox effect with the post attachment automatic slide output: http://revelationconcept.com/wordpress-display-all-post-attachment-images-in-a-slider/
// Add this after line 18 in the example:
$thumb_array = image_downsize( $image->ID, 'your-custom-image-size' );
$thumb_url = $thumb_array[0];
// Now, you will need to modify the output to include your thumbnail image, a link to the full image and your lighbox classes. So lines 20-28 should look something like this:
echo '<li>';
echo '<a class="your-lightbox-class" href="';
echo $img_url;
@RevConcept
RevConcept / rc-custom-walker
Created May 23, 2013 16:36
This is my setup for the Custom Walker Menu we discussed at the AWP meetup. I've included the shortcode setup as well that allows the user to past a simple shortcode that will spit these custom menus out onto the page. See a live version here: http://bojacksonselitesports.com/sports-programs/bo-jackson-football
/* ==========================================================================
Custom Walker Menu for Secondary Navigation Page Templates
========================================================================== */
class Menu_With_Description extends Walker_Nav_Menu {
function start_el(&$output, $item, $depth, $args) {
global $wp_query;
$indent = ( $depth ) ? str_repeat( "t", $depth ) : '';
/*
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 / recipet-query.php
Last active August 29, 2015 14:13
Conditional Query for Recipe Archive
<?php // DEFAULT LOOP
if( (!isset($_POST['product_selection']) || '' == $_POST['product_selection']) && (!isset($_POST['cat_selection']) || '' == $_POST['cat_selection'] )) { ?>
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$query = new WP_Query( array(
'post_type' => 'recipes', // your CPT
<?php
function recipe_product_filter() {
global $post;
// Query products
$query = new WP_Query(array(
'post_type' => 'recipes',