Skip to content

Instantly share code, notes, and snippets.

Avatar

Carrie Dils cdils

View GitHub Profile
View archive-team.php
<?
/**
* Team Archive template
*/
// Remove default post title (with link)
remove_action( 'genesis_entry_header','genesis_do_post_title' );
add_action( 'genesis_entry_header','cd_archive_title' );
/**
@cdils
cdils / functions.php
Created Feb 23, 2015
Add latest post revision date to Genesis post info.
View functions.php
<?php //remove this line
add_filter( 'genesis_post_info', 'cd_post_info_filter' );
function cd_post_info_filter( $post_info ) {
if ( ! is_singular( 'post' ) ) {
$post_info = '[post_date] by [post_author_posts_link] [post_comments]';
$post_modified_info = '[post_modified_date before="<br />Last updated "]';
return $post_info . $post_modified_info;
@cdils
cdils / example-typekit.css
Created Jan 13, 2015
Example of overriding Style Customizer fonts with a Typekit font. (For additional context see http://www.carriedils.com/typekit-rainmaker/)
View example-typekit.css
/*
Note the .site-container class - this adds extra specification to areas
where the Style Customizer is applying styles. You can directly target
other styles that come directly from the theme (hint: you can identify them
because they don't include the .gppro-custom class)
------*/
body.gppro-custom .site-container,
body.gppro-custom .site-container .genesis-grid .entry-meta,
body.gppro-custom .site-container .entry-header .entry-meta,
body.gppro-custom .site-container .site-footer p,
View custom-body-class.php
<?php // Remove this entire line
// Add custom class to the body tag
add_filter( 'body_class', 'add_body_class' );
function add_body_class( $classes ) {
$classes[] = 'name-of-class';
return $classes;
}
@cdils
cdils / page_landing.php
Created Nov 2, 2014
Landing page template for the Utility Theme
View page_landing.php
<?php
/**
* This file adds the Landing template to the Utility Theme.
*
* @author Carrie Dils
* @package Utility
* @subpackage Customizations
*/
/*
@cdils
cdils / functions.php
Last active Apr 26, 2017
Remove Pagination from an archive
View functions.php
<?php //remove this entire line
// Remove Pagination from a custom post type
add_action( 'parse_query', 'cd_nopaging' );
function cd_nopaging( $query ) {
if ( is_post_type_archive( 'your-cpt' ) ) {
$query->set( 'nopaging', 1 );
}
@cdils
cdils / functions.php
Created Sep 15, 2014
Hook site avatar before site title
View functions.php
//* Hook site avatar before site title
add_action( 'genesis_header', 'sixteen_nine_site_gravatar', 5 );
function sixteen_nine_site_gravatar() {
$header_image = get_header_image() ? '<img alt="" src="' . get_header_image() . '" />' : get_avatar( get_option( 'admin_email' ), 224 );
printf( '<div class="site-avatar"><a href="%s">%s</a></div>', home_url( '/' ), $header_image );
}
@cdils
cdils / functions.php
Created Jul 21, 2014
Genesis Pagination stuff
View functions.php
<?php //remove this entire line
// Use this to completely remove pagination on archive pages
remove_action( 'genesis_after_endwhile', 'genesis_posts_nav' );
@cdils
cdils / remove-post-details.php
Created May 26, 2014
Remove post info and post meta from some custom post type pages.
View remove-post-details.php
<?php //remove this entire line with opening tag
//Remove post info and post meta on custom post types
add_action ( 'get_header', 'cd_remove_post_details');
function cd_remove_post_details() {
if ( is_singular( array( 'press', 'filmmaker' ) ) ) {
remove_action ( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action ( 'genesis_entry_footer', 'genesis_post_meta' );
@cdils
cdils / Customize the Contact Info Fields in WordPress Profiles 6
Last active Aug 29, 2015
Add custom contact fields in the WordPress User Edit screen.
View Customize the Contact Info Fields in WordPress Profiles 6
// Customize the contact information fields available to users
add_filter( 'user_contactmethods', 'change_contact_info', 10, 1);
function change_contact_info( $contactmethods ) {
$contactmethods['website_title'] = 'Website Title';
$contactmethods['twitter'] = 'Twitter';
$contactmethods['facebook'] = 'Facebook';
$contactmethods['linkedin'] = 'Linked In';
return $contactmethods;