Skip to content

Instantly share code, notes, and snippets.

<?php
function login_with_email_address($username) {
$user = get_user_by_email($username);
if(!empty($user->user_login))
$username = $user->user_login;
return $username;
}
add_action('wp_authenticate','login_with_email_address');
@brycejacobson
brycejacobson / customize.php
Created July 18, 2013 16:19 — forked from studiopress/customize.php
WordPress Genesis Customization's
<?php
//* Do NOT include the opening php tag
//* Customize the entry meta in the entry header (requires HTML5 theme support)
add_filter( 'genesis_post_info', 'post_info_filter' );
function post_info_filter($post_info) {
$post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]';
return $post_info;
}
@brycejacobson
brycejacobson / functions.php
Created July 18, 2013 17:37
White Label Soliloquy
<?php
//* Do NOT include the opening php tag
//* White Label Soliloquy Plugin
add_filter( 'tgmsp_strings', 'tgm_custom_slider_strings' );
function tgm_custom_slider_strings( $strings ) {
$strings['add_slider'] = 'Add Slider';
$strings['addon_intro'] = 'The following Addons can be used to extend the functionality of your slider.';
$strings['addons_page_title'] = 'Slider Addons';
@brycejacobson
brycejacobson / functions.php
Created July 18, 2013 20:35
Add wrapper div to Soliloquy caption
<?php
//* Do NOT include the opening php tag
//* Add wrapper div to Soliloquy caption
add_filter( 'tgmsp_caption_output', 'tgm_custom_caption', 10, 3 );
function tgm_custom_caption( $output, $id, $image ) {
return '<div class="soliloquy-caption-wrapper"><div class="soliloquy-caption"><div class="soliloquy-caption-inside">' . do_shortcode( $image['caption'] ) . '</div></div></div>';
}
@brycejacobson
brycejacobson / genesis-custom-enqueue-script.php
Created July 23, 2013 13:08 — forked from jonbellah/gist:4583404
Load custom scripts on specific pages in WordPress using Genesis.
<?php
//* Do NOT include the opening php tag
/** Load scripts on Portfolio page */
add_action('genesis_after_footer', 'child_load_portfolio');
function child_load_portfolio() {
if(is_page('Portfolio')) {
wp_register_script( 'isotope', get_bloginfo('stylesheet_directory').'/lib/js/jquery.isotope.min.js' );
wp_enqueue_script ( 'isotope' );
}
@brycejacobson
brycejacobson / css-retina-logo.css
Created July 23, 2013 13:12 — forked from jonbellah/Single media query
CSS for retina logo using background image.
.logo {
background: url(images/example.jpg);
}
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
.logo {
background: url(images/example@2x.jpg);
background-size: 100px 100px;
}
@brycejacobson
brycejacobson / is_tree.php
Created August 13, 2013 20:54
WordPress is_tree function to see if a page is an ancestor.
<?php
//* Do NOT include the opening php tag
//* Determin if a page is an ancestor
function is_tree($pid) // $pid = The ID of the page we're looking for pages underneath
{
global $post; // load details about this page
$ancestors = get_post_ancestors($post->$pid);
$root = count($ancestors) - 1;
@brycejacobson
brycejacobson / child-theme-settings.php
Created August 14, 2013 21:35
Genesis Child Theme Settings Page
<?php
/**
* Creates the Child Theme Settings page.
* genesis/lib/admin/seo-settings.php
*/
/**
* Registers a new admin page, providing content and corresponding menu item
* for the Child Theme Settings page.
*/
@brycejacobson
brycejacobson / search-form-input-box.php
Created August 20, 2013 21:17 — forked from studiopress/search-form-input-box.php
Genesis search form functions.
<?php
//* Do NOT include the opening php tag
//* Customize search form input box text
add_filter( 'genesis_search_text', 'sp_search_text' );
function sp_search_text( $text ) {
return esc_attr( 'Search my blog...' );
}
@brycejacobson
brycejacobson / genesis_html5_doctype.php
Created August 23, 2013 17:06
Add Conditional Classes to the HTML Tag in Genesis 2.0
<?php
//* Do NOT include the opening php tag
//* Remove the default Genesis doctype, add new html5 doctype with IE8 detection
function mb_html5_doctype() {
?>
<!DOCTYPE html>
<!--[if IE 8]> <html class="lt-ie9" <?php language_attributes( 'html' ); ?>> <![endif]-->
<!--[if gt IE 8]><!--> <html <?php language_attributes( 'html' ); ?>> <!--<![endif]-->