Skip to content

Instantly share code, notes, and snippets.

@leepettijohn
leepettijohn / Alphabetize code
Created December 16, 2014 15:06
Alphabetize
//Alphabetize the products
function modify_query_order( $query ) {
$cat = the_category_ID($echo=false);
if (is_category(8) || cat_is_ancestor_of(8,$cat)){
global $query_string;
query_posts($query_string."&order=ASC&orderby=title");
}
}
@leepettijohn
leepettijohn / jump to form code
Created December 16, 2014 15:11
Jump to Form Upon Submission
//* Jump to message on Gravity Forms
add_filter(“gform_confirmation_anchor”, create_function(“”,”return true;”));
@leepettijohn
leepettijohn / add featured image code
Last active April 16, 2019 14:06
Add Featured Image Link
@leepettijohn
leepettijohn / add featured image
Created December 16, 2014 15:51
Add Featured Image to the left of the article
@leepettijohn
leepettijohn / functions.php
Created December 18, 2014 19:59
Gravity Form - Scroll to Message
//* Scroll to message on Gravity Forms
add_filter("gform_confirmation_anchor", create_function("","return true;"));
@leepettijohn
leepettijohn / functions.php
Last active April 16, 2019 14:06
Removing Meta Info
add_action('genesis_before_loop','remove_info');
function remove_info(){
if (in_category(ADD_CATEGORY_NUMBER_HERE)){
//This removes the author, date, etc. at the top of the post
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
//This removes the categories and tags at the bottom of the post
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
}
}
@leepettijohn
leepettijohn / functions.php
Created January 2, 2015 15:25
Changing Read More Links in Blog Page
// Edit the read more link text
add_filter('get_the_content_more_link', 'custom_read_more_link');
add_filter('the_content_more_link', 'custom_read_more_link');
function custom_read_more_link() {
return '&nbsp;<a class="more-link" href="' . get_permalink() . '">Keep Reading &hellip;</a>';
}
@leepettijohn
leepettijohn / functions.php
Last active April 16, 2019 14:06
Add image to top of pages and posts
add_image_size( 'featured-top', 750, 500, TRUE );
add_action ('genesis_before_loop','add_top_image');
function add_top_image(){
if (is_page() || is_single()){
the_post_thumbnail('featured-top',array('class'=>'top-of-post'));
}
}
// Use this one if it's full width and needs to be a background image
@leepettijohn
leepettijohn / functions.php
Created February 3, 2015 20:44
Genesis Framework - Add Custom Header
add_theme_support( 'custom-header', array(
'width' => 541,
'height' => 200,
'header-text' => false,
'header-selector' => '.site-title a'
)
);
@leepettijohn
leepettijohn / functions.php
Created February 5, 2015 16:19
Set "Link to" in Media to 'None'
update_option('image_default_link_type','none');