Skip to content

Instantly share code, notes, and snippets.

View j-gardner's full-sized avatar

John Gardner j-gardner

View GitHub Profile
@j-gardner
j-gardner / gist:9499412
Last active August 29, 2015 13:57
Modify portfolio image links to open them in new windows
jQuery(document).ready( function(){
jQuery( "ul.arconix-portfolio-grid a.portfolio-image" ).attr( 'target', '_blank' );
});
@j-gardner
j-gardner / gist:10437717
Created April 11, 2014 02:25
Add a requirement that only items which have a featured image should be returned
<?php
// In your theme's functions.php file
add_filter( 'arconix_flexslider_loop_args', 'thumbnail_meta' );
function thumbnail_meta( $args ) {
$args['meta_key'] = "_thumbnail_id";
return $args;
}
@j-gardner
j-gardner / gist:10469315
Last active August 29, 2015 13:59
Exclude Additional Post Types from the Arconix Flexslider widget select box
<?php
// In your theme's functions.php file
// To add 1 post type to the exclude list
add_filter( 'arconix_flexslider_exclude_post_types', 'exclude_pt' );
function exclude_pt( $post_types ) {
$post_types[] = 'post_type_name';
return $post_types;
@j-gardner
j-gardner / gist:10928035
Created April 16, 2014 20:11
Add post tags support to a custom post type (in this case "portfolio")
<?php
/**
* Adds Post Tag support to a custom post type.
*
* This code is set to work with Arconix Portfolio, however
* the code should work with any of my plugins, simply
* change the 1st filter argument to match, i.e.
* 'arconix_testimonials_defaults' as I structure my
* defaults pretty much the same across all my plugins
*/
@j-gardner
j-gardner / gist:4f5abb3350a9a585bad3
Created September 6, 2014 12:29
Code Shortcode example
[code]get_the_content()[/code]
@j-gardner
j-gardner / gist:0f3adc735eb9ec7b5b39
Last active August 29, 2015 14:06
Add the googlemap shortcode back
<?php // DO NOT include the opening php tag
add_filter( 'arconix_shortcodes_list', 'add_gmap' );
function add_gmap( $list ) {
$list[] = 'googlemap';
return $list;
}
@j-gardner
j-gardner / TwentyTenSingle.php
Created May 30, 2012 15:52
TwentyTen Single.php
<?php
/* Run the loop to output the post.
* If you want to overload this in a child theme then include a file
* called loop-single.php and that will be used instead.
*/
get_template_part( 'loop', 'single' );
?>
@j-gardner
j-gardner / gist:2837780
Created May 30, 2012 17:25
TwentyTen Single Loop
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<div id="nav-above" class="navigation">
<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div>
<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'twentyten' ) . '</span>' ); ?></div>
</div><!-- #nav-above -->
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h1 class="entry-title"><?php the_title(); ?></h1>
<div class="entry-meta">
@j-gardner
j-gardner / gist:2840634
Created May 31, 2012 02:47
TwentyTen Post Thumbnail
<div class="entry-content">
<?php the_post_thumbnail( 'portfolio-large' ); ?>
<?php the_content(); ?>
@j-gardner
j-gardner / gist:2840638
Created May 31, 2012 02:48
Feature Tags TwentyTen single-portfolio
<div class="entry-utility">
<?php echo get_the_term_list( $post->ID, 'feature', '<div class="arconix-portfolio-tax-list"><span class="arconix-portfolio-tax-title">Features: </span>', ', ', '</div>' ); ?>
<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>