Skip to content

Instantly share code, notes, and snippets.

View braddalton's full-sized avatar

Brad Dalton braddalton

View GitHub Profile
add_action('genesis_before_post', 'gravity_form_before_content');
function gravity_form_before_content() {
if (is_category()) {
echo do_shortcode('[gravityform id=1 title=false description=false ajax=true]');
}
}
function display_slider_header_home() {
if ( is_home() && function_exists('easingsliderlite') ) {
easingsliderlite();
}
};
add_action('genesis_header', 'display_slider_header_home');
/**
* @author Brad Dalton - WP Sites
* @example http://wpsites.net/web-design/image-slider-home-page-only/
function display_slider_header_home() {
if ( is_category() && function_exists('easing_slider') ) {
easing_slider();
}
};
add_action('genesis_header', 'display_slider_header_home');
function display_slider_header_home() {
if ( is_single() && function_exists('easingsliderlite') ) {
easingsliderlite();
}
};
add_action('genesis_before_post', 'display_slider_header_home');
update_option('image_default_link_type', 'none')
function default_image_link_type() {
$image_set = get_option( 'image_default_link_type' );
if ($image_set !== 'post') {
update_option('image_default_link_type', 'post');
}
}
/**
function remove_posts_from_wp_search($query) {
if ($query->is_search) {
$query->set('post_type', 'page');
}
return $query;
}
add_filter('pre_get_posts','remove_posts_from_wp_search');
function remove_post_type_page_from_search() {
global $wp_post_types;
$wp_post_types['page']->exclude_from_search = true;
}
add_action('init', 'remove_post_type_page_from_search');
function remove_categories_wp_search($query) {
if ( $query->is_search() {
$query->set('cat','-1,-10');
}
return $query;
}
add_filter('pre_get_posts','remove_categories_wp_search');
genesis_register_sidebar( array(
'id' => 'text-before-blog',
'name' => 'Text Before Blog',
'description' => 'This is the widget for displaying text before blog posts.',
) );
add_action('genesis_before_content', 'apparition_text_before_blog' );
function apparition_text_before_blog() {
if( is_page_template('page_blog.php') ) {