Skip to content

Instantly share code, notes, and snippets.

//* Customize the login page (see https://premium.wpmudev.org/blog/customize-login-page/)
add_action('login_head', 'pasada_custom_login');
function pasada_custom_login() {
echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo('stylesheet_directory') . '/login.css" />';
}
add_filter( 'login_headerurl', 'pasada_login_logo_url' );
function pasada_login_logo_url() {
return get_bloginfo( 'url' );
}
@pasadamedia
pasadamedia / gist:2a7c433b6f4aa17cdab1
Created May 15, 2015 01:27
Override default favicon in Genesis child theme with custom retina-friendly versions from realfavicongenerator.net.
//* Add favicons (created at http://realfavicongenerator.net/)
remove_action( 'wp_head', 'genesis_load_favicon' );
add_action( 'wp_head', 'pasada_load_favicon' );
function pasada_load_favicon() {
echo '<link rel="apple-touch-icon" sizes="57x57" href="/wp-content/themes/pasada/images/favicon.ico/apple-touch-icon-57x57.png">';
echo '<link rel="apple-touch-icon" sizes="60x60" href="/wp-content/themes/pasada/images/favicon.ico/apple-touch-icon-60x60.png">';
echo '<link rel="apple-touch-icon" sizes="72x72" href="/wp-content/themes/pasada/images/favicon.ico/apple-touch-icon-72x72.png">';
echo '<link rel="apple-touch-icon" sizes="76x76" href="/wp-content/themes/pasada/images/favicon.ico/apple-touch-icon-76x76.png">';
echo '<link rel="apple-touch-icon" sizes="114x114" href="/wp-content/themes/pasada/images/favicon.ico/apple-touch-icon-114x114.png">';
@pasadamedia
pasadamedia / gist:c18d5cd135ddb5085ed0
Last active March 23, 2018 19:46
Display WooThemes Sensei comments and messages in a Genesis framework child theme. Insert in your child theme's functions.php file.
/**
* Remove Sensei comments output and replace with comments done the Genesis way.
*
* @notes Extends the WooThemes_Sensei_Frontend class.
*
*/
if (class_exists('WooThemes_Sensei_Frontend')) {
remove_action( 'sensei_comments', array( $woothemes_sensei->frontend, 'sensei_output_comments' ), 10 );
add_action( 'sensei_comments', array( 'WooThemes_Sensei_Frontend_Comments', 'pasada_sensei_output_comments' ), 10 );
@pasadamedia
pasadamedia / gist:aa6e9d54ff2bec925709
Created February 8, 2015 04:02
Add "Portfolio" tab to BuddyPress member profile
<?php
/**
* Add a new "Portfolio" profile tab and load content.
*
* @link http://premium.wpmudev.org/forums/topic/buddypress-adding-custom-page-tab
*
*/
add_action( 'bp_setup_nav', 'pasada_profile_portfolio', 50 );
function pasada_profile_portfolio() {
@pasadamedia
pasadamedia / gist:fa0a13cfa43c69f7a51f
Created January 28, 2015 06:02
Display WooThemes Sensei featured courses in a page template
/**
* Display Sensei Featured Courses.
*
* Displays a list of featured courses.
*
* @since 1.0.0
* @return void
* @uses WP_Query()
* @link http://www.woothemes.com/sensei/
* @author WooThemes
@pasadamedia
pasadamedia / functions.php
Created November 28, 2014 13:11
Remove and replace Google and iCal links on single event pages, with the link modified to open in new tab.
/**
* Remove and replace Google and iCal links on single event pages, with the link modified to open in new tab.
*
*/
remove_action( 'tribe_events_single_event_after_the_content', array( 'TribeiCal', 'single_event_links' ) );
add_action('tribe_events_single_event_after_the_content', 'tribe_add_cal_link');
function tribe_add_cal_link() {
@pasadamedia
pasadamedia / functions.php
Created November 28, 2014 12:23
Event featured image wrapped in a link to a larger version of the same image.
/**
* Event featured image wrapped in a link to a larger version of the same image.
*
* Replaces tribe_event_featured_image to enable link to a larger version for display in a lightbox.
* Called in custom single event template file (/pasada/tribe-events/single-event.php).
*
*/
function pasada_tribe_event_featured_image( $post_id = null, $size = 'full', $size2 = 'large', $link = true ) {
if ( is_null( $post_id ) ) {
$post_id = get_the_ID();
@pasadamedia
pasadamedia / functions.php
Created November 28, 2014 06:46
Remove allowed tags notice on comment form.
/**
* Remove allowed tags notice on comment form.
*
*/
function pasada_remove_comment_form_allowed_tags( $defaults ) {
$defaults['comment_notes_after'] = '';
return $defaults;
}
@pasadamedia
pasadamedia / functions.php
Created November 28, 2014 06:45
Customize Genesis footer credits.
/**
* Customize Genesis footer credits.
*
*/
function pasada_footer_creds_text() {
echo '<div class="creds"><p>&copy; Copyright ' . date('Y') . ' <a href="http://www.globalmindbody.org/" title="Global Mind Body" target="_blank">Global Mind Body</a> &middot;&nbsp;<a href="/contact/" title="Contact us">Contact</a>&nbsp;&middot;&nbsp;<a href="/privacy/" title="Privacy policy">Privacy</a>&nbsp;&middot;&nbsp;<a href="/terms/" title="Terms of use">Terms</a></p></div>';
}
add_filter( 'genesis_footer_creds_text', 'pasada_footer_creds_text' );
@pasadamedia
pasadamedia / functions.php
Created November 28, 2014 06:44
Modify display of post entries on Genesis blog and archive pages.
/**
* Modify display of post entries on Genesis blog and archive pages.
*
*/
function pasada_modify_entries() {
if ( is_home() || is_author() || is_category() || is_tag() || is_search() ) {
// Remove unwanted post elements.
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );