Skip to content

Instantly share code, notes, and snippets.

@jdspiral
jdspiral / gist:7e07144b7949e4bfb462
Last active June 10, 2019 10:01
This is a modified filter for editing the Genesis AgentPress Output
add_filter( 'agentpress_featured_listings_widget_loop', 'agentpress_featured_listings_widget_loop_filter' );
/**
* Filter the loop output of the AgentPress Featured Listings Widget.
*
*/
function agentpress_featured_listings_widget_loop_filter( $loop ) {
$loop = ''; /** initialze the $loop variable */
$loop .= sprintf( '<a href="%s">%s</a>', get_permalink(), genesis_get_image( array( 'size' => 'feature-community' ) ) );
@jdspiral
jdspiral / gist:ec79a9f5e398f9507f52
Created December 29, 2014 21:00
Genesis Agents Page with Left Sidebar
<?php
/**
*
* @package Genesis\Templates
* @author Josh Hathcock
* @license GPL-2.0+
* @link http://my.studiopress.com/themes/genesis/
*/
/*
@jdspiral
jdspiral / gist:c786f59f3a53cbd34aa8
Last active August 29, 2015 14:13
Edit Site Title - Genesis
// Edit Site Title
remove_action( 'genesis_site_title', 'genesis_seo_site_title' );
add_action( 'genesis_site_title', 'jds_seo_site_title' );
function jds_seo_site_title() {
echo '<h1 id="title"><a href="#">JDSpiral</a></h1>';
}
@jdspiral
jdspiral / logo-genesis.php
Last active August 29, 2015 14:13
Add logo to header and remove h1
// Remove H1 from title and add logo
add_filter( 'genesis_seo_title', 'jds_header_title', 10, 3 );
function jds_header_title( $title, $inside, $wrap ) {
$inside = sprintf( '<div itemscope="itemscope" itemtype="http://schema.org/Organization"><a itemprop="url" href="%s" title="%s">
<img class="logo" itemprop="logo" src="' . get_stylesheet_directory_uri() . '/images/logo.png" alt="%s" width="" height="" />
</a></div>', trailingslashit( home_url() ), esc_attr( get_bloginfo( 'name' ) ), get_bloginfo( 'name' ) );
return sprintf( '<%1$s id="title">%2$s</%1$s>', 'span', $inside );
}
@jdspiral
jdspiral / shortcode.php
Last active November 18, 2015 04:49
Enable Shortcode in widgets
// Enable Shortcode in widgets - Note: This is not recommended. This is plugin functionality.
add_filter('widget_text', 'do_shortcode');
@jdspiral
jdspiral / gist:37cbd29b613f8aa255a8
Created January 13, 2015 20:09
Customize the post info function
//* Customize the post info function
remove_action( 'genesis_entry_header', 'genesis_post_info', 12);
add_action( 'genesis_entry_header', 'genesis_post_info', 9 );
add_filter( 'genesis_post_info', 'jds_post_info_filter' );
function jds_post_info_filter($post_info) {
if (is_home() || is_archive()) {
$post_info = '[post_categories before=""] [post_comments] [post_edit]';
return $post_info;
}
@jdspiral
jdspiral / gist:cfbeed52c11993f8c6e4
Last active August 29, 2015 14:13
Add featured image
//* Add featured image
add_action ( 'genesis_entry_header', 'jds_featured_image', 15);
function jds_featured_image() {
if ( is_single() )
return;
if ($image = genesis_get_image('format=url&amp;size=thumbnail')) {
echo '<div class="alignleft">';
printf('<a href="%s"><img class="alignleft" src="%s" alt="%s" /></a>', get_permalink(), $image, the_title_attribute('echo=0'));
echo '</div>';
}
@jdspiral
jdspiral / gist:f11f98c88cecc8da1b10
Created January 13, 2015 20:11
Custom Image Sizes
//Custom Image Sizes
add_image_size( 'featured-image', 236, 153, TRUE );
@jdspiral
jdspiral / edit-read-more-link.php
Last active August 29, 2015 14:13
Edit Read More Link
@jdspiral
jdspiral / remove-breadcrumbs-custom-template.php
Last active August 29, 2015 14:13
Remove breadcrumb from a custom template page
//* Remove breadcrumb from a custom template page
add_action( 'genesis_before', 'jds_remove_genesis_breadcrumb' );
function jds_remove_genesis_breadcrumb() {
if ( is_page_template( 'page_landing.php' ) )
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
}