Skip to content

Instantly share code, notes, and snippets.

Avatar

Angie Vale PurpleHippoDesign

View GitHub Profile
View after-entry-widget.php
<?php // Get rid of this tag
//* Register widget areas
genesis_register_sidebar( array(
'id' => 'after-entry',
'name' => __( 'After Entry', 'theme-prefix' ),
'description' => __( 'This is the after entry section.', 'theme-prefix' ),
) );
//* Hooks after-entry widget area to single posts
@PurpleHippoDesign
PurpleHippoDesign / add-multiple-genesis-grid-loops
Last active Aug 29, 2015
Adds Multiple Genesis Grid Loops Displaying Different Categories
View add-multiple-genesis-grid-loops
<?php
//* Do NOT include the opening php tag
//* Add multiple grid loops to a page template*/
remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop
add_action( 'genesis_loop', 'custom_do_grid_loop' ); // Add custom loop
function custom_do_grid_loop() {
$args = array(
@PurpleHippoDesign
PurpleHippoDesign / add-image-to-single
Created May 16, 2014
Adds the featured image to single posts
View add-image-to-single
// add featured image to single posts
add_action ( 'genesis_entry_header', 'pbh_featured_image_title_singular' );
function pbh_featured_image_title_singular() {
if ( !is_singular() || !has_post_thumbnail() )
return;
echo '<div class="singular-thumbnail">';
genesis_image( array( 'size' => 'medium' ) );
@PurpleHippoDesign
PurpleHippoDesign / remove-post-info-for-cpt.php
Created Jun 26, 2014
Remove post info and post info on custom post type
View remove-post-info-for-cpt.php
<?php // Get rid of this tag
// Remove Post Info, Post Meta from CPT
function pbh_remove_post_info() {
if( 'testimonial' == get_post_type() ) {
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
}
}
@PurpleHippoDesign
PurpleHippoDesign / conditional-tag-for-multiple-cpt.php
Last active Aug 29, 2015
Conditional tag for multiple custom post types
View conditional-tag-for-multiple-cpt.php
<?php // Get rid of this tag
// Remove Post Info and Post Meta from Custom Post Types
function pbh_remove_post_info() {
if ( in_array(get_post_type(), array ('testimonial', 'project'))) {
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
}
}
add_action ( 'get_header', 'pbh_remove_post_info' );
@PurpleHippoDesign
PurpleHippoDesign / taxonomy-filter.php
Last active Aug 29, 2015
Adds category filter for custom post types
View taxonomy-filter.php
<?php // get rid of this tag
// Filter the request to just give posts for the given taxonomy, if applicable.
function taxonomy_filter_restrict_manage_posts() {
global $typenow;
$post_types = get_post_types( array( '_builtin' => false ) );
if ( in_array( $typenow, $post_types ) ) {
$filters = get_object_taxonomies( $typenow );
View add-cpt-to-rss.php
<?php
// Note: Add only code below to your functions.php
// Add custom post types - cpt1 and cpt2 to main RSS feed.
function mycustomfeed_cpt_feed( $query ) {
if ( $query->is_feed() )
$query->set( 'post_type', array( 'post', 'cpt1', 'cpt2' ) );
return $query;
}
add_filter( 'pre_get_posts', 'mycustomfeed_cpt_feed' );
@PurpleHippoDesign
PurpleHippoDesign / retina-media-query.css
Last active Aug 29, 2015
Add retina logo to Genesis
View retina-media-query.css
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and ( min-device-pixel-ratio: 2),
only screen and ( min-resolution: 192dpi),
only screen and ( min-resolution: 2dppx) {
.header-image .site-title > a {
float: left;
min-height: 133px;
View display-gallery-as-soliloquy-dynamic-slider.php
@PurpleHippoDesign
PurpleHippoDesign / screen-reader-text-class.css
Last active Jan 10, 2016
CSS to hide anchor text for accessibility
View screen-reader-text-class.css
a span.screen-reader-text {
clip: rect(1px, 1px, 1px, 1px);
position: absolute !important;
height: 1px;
width: 1px;
overflow: hidden;
}
You can’t perform that action at this time.