This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* =========================================== | |
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* =========================================== | |
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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function recipe_product_filter() { | |
global $post; | |
// Query products | |
$query = new WP_Query(array( | |
'post_type' => 'recipes', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ========================================================================== | |
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 ) : ''; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |
OlderNewer