Skip to content

Instantly share code, notes, and snippets.

View wpspeak's full-sized avatar

WPSpeak wpspeak

View GitHub Profile
@wpspeak
wpspeak / functions.php
Created September 27, 2015 02:09
Remove Genesis Framework Breadcrumb
<?php
//* Remove metaboxes in Genesis settings page
function afn_remove_metaboxes( $_genesis_theme_settings_pagehook ) {
remove_meta_box( 'genesis-theme-settings-breadcrumb', $_genesis_theme_settings_pagehook, 'main' );
}
add_action( 'genesis_theme_settings_metaboxes', 'afn_remove_metaboxes' );
@wpspeak
wpspeak / functions.php
Last active August 4, 2019 06:58
Remove 'You are here' texts in Genesis Framework breadcrumb
<?php
//* Remove 'You are here' texts in Genesis Framework breadcrumb
add_filter( 'genesis_breadcrumb_args', 'afn_breadcrumb_args' );
function afn_breadcrumb_args( $args ) {
$args['labels']['prefix'] = '';
return $args;
}
@wpspeak
wpspeak / functions.php
Created May 20, 2013 15:25
/** Customize the length of excerpts */
<?php
/** Customize the length of excerpts */
add_filter( 'excerpt_length', 'new_excerpt_length' );
function new_excerpt_length( $length ) {
return 30;
}
@wpspeak
wpspeak / functions.php
Created May 31, 2013 02:26
Exclude pages in search
<?php
/** Exclude Page in Search */
function exclude_search_pages($query) {
if ($query->is_search) {
$query->set('post_type', 'post');
}
return $query;
}
@wpspeak
wpspeak / functions.php
Created June 2, 2013 20:17
Swap position of image with title and add back the post info in Genesis 2.0
<?php
// Swap image with title and add back the post info in Genesis 2.0
remove_action( 'genesis_entry_content', 'genesis_do_post_image' );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
add_action( 'genesis_entry_header', 'genesis_do_post_image' );
add_action( 'genesis_entry_content', 'genesis_do_post_title' );
add_action( 'genesis_entry_content', 'genesis_post_info' );
@wpspeak
wpspeak / functions.php
Created June 9, 2013 21:39
Add new featured image sizes
<?php
// Add new featured image sizes
add_image_size( 'grid-thumbnail', 236, 157, TRUE );
add_image_size( 'single-post-thumbnail', 236, 236, TRUE );
add_image_size( 'video-small', 110, 73, TRUE );
@wpspeak
wpspeak / functions.php
Created June 11, 2013 06:30
Add shortcode for search form in Genesis Framework
<?php
/**
* Search Shortcode Excerpt
* @since 1.1 Genesis 404 Page plugin
* @author Bill Erickson
*/
function search_shortcode() {
return '<div class="genesis-404-search">' . get_search_form( false ) . '</div>';
}
@wpspeak
wpspeak / functions.php
Created June 14, 2013 22:10
Load Google Custom Fonts
<?php
//* Do NOT include the opening php tag
//* Load Lato and Merriweather Google fonts
add_action( 'wp_enqueue_scripts', 'custom_load_google_fonts' );
function custom_load_google_fonts() {
wp_enqueue_style( 'google-font', 'http://fonts.googleapis.com/css?family=Lato:300,400|Merriweather:300,400', array(), PARENT_THEME_VERSION );
}
@wpspeak
wpspeak / functions.php
Created June 15, 2013 10:11
Use Typekit fonts in WordPress without plugin
<?php
/**
* TypeKit Fonts
* @since Theme 1.0
* @url http://wptheming.com/2013/02/typekit-code-snippet/
*
*/
function theme_typekit() {
wp_enqueue_script( 'theme_typekit', '//use.typekit.net/xxxxxxx.js');
@wpspeak
wpspeak / functions.php
Created June 16, 2013 08:56
Add shortcode for search form in WordPress
<?php
/*
* Add a shortcode for search form in WordPress
* @url http://www.paulund.co.uk/display-wordpress-search-form
*/
function search_form_shortcode( ) {
get_search_form( );
}