Skip to content

Instantly share code, notes, and snippets.

View RevConcept's full-sized avatar

Chris RevConcept

View GitHub Profile
@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 ) : '';
@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 / 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 / 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 / revcon_get_images
Created January 29, 2014 20:12
WordPress: Display All Post Attachment Images In A Slider. Original post here: http://revelationconcept.com/wordpress-display-all-post-attachment-images-in-a-slider
// This is modified to show the image captions
function revconcept_get_images($post_id) {
global $post;
$thumbnail_ID = get_post_thumbnail_id();
$images = get_children( array('post_parent' => $post_id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') );
if ($images) :
@RevConcept
RevConcept / functionality.php
Created March 4, 2014 23:35
Adding custom icons to ACF radio buttons.
/* ===========================================
Radio Button Icons in Admin for ACF
=============================================*/
function sr_acf_radio_style() {
echo '<link rel="stylesheet" href="' . plugins_url( 'css/jazz.css', __FILE__) . '" type="text/css" media="screen" />';
}
add_action('admin_head', 'sr_acf_radio_style');
<?php
/* ===========================================
Send Emails when User Profile Changes
=============================================*/
// IF EMAIL CHANGES
function sr_user_profile_update_email( $user_id, $old_user_data ) {
$user = get_userdata( $user_id );
@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) {
<?php
function recipe_product_filter() {
global $post;
// Query products
$query = new WP_Query(array(
'post_type' => 'recipes',
@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