Skip to content

Instantly share code, notes, and snippets.

@cdils
cdils / custom_logo_link.php
Created February 22, 2013 00:23
Customize the link and logo on the WordPress login page.
@cdils
cdils / archive-testimonials.php
Created March 13, 2013 13:49
Testimonial Archive Template
<?php
/**
* Template Name: Testimonial Archives
* Description: Used as a page template to show page contents, followed by a loop through a CPT archive
*/
remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop
add_action( 'genesis_loop', 'custom_do_grid_loop' ); // Add custom loop
@cdils
cdils / custom-widget-areas.php
Last active December 15, 2015 17:29
Custom Widget Areas for CTAS on carriedils.com
/** Register widget areas */
genesis_register_sidebar( array(
'id' => 'cta-1',
'name' => __( 'Call to Action #1', 'mp' ),
'description' => __( 'This is the call to action section.', 'mp' ),
) );
genesis_register_sidebar( array(
'id' => 'cta-2',
@cdils
cdils / CTA-Widgets.php
Created April 2, 2013 22:57
CTA Widget displays for carriedils.com
/**
* Add CTA widget support for site. If widget not active, don't display
*
*/
function mp_cta_genesis() {
// Don't display the CTA on the home page, since it's built into the MP theme
if ( is_home() ) {
return;
}
@cdils
cdils / gist:5430275
Last active December 16, 2015 11:49 — forked from billerickson/gist:1535891
Change the sort order for an archive template by a custom field.
<?php
/**
* Change the post order for listings
*
* @author Carrie Dils
* @link http://www.billerickson.net/customize-the-wordpress-query/
* @reference http://codex.wordpress.org/Class_Reference/WP_Query
*
*/
@cdils
cdils / home.php
Created April 21, 2013 19:12
Custom home page layout for a Genesis Theme showing Featured widget, three middle widgets, and two bottom widgets.
<?php
add_action( 'genesis_meta', 'custom_home_genesis_meta' );
/**
* Add widget support for homepage. If no widgets active, display the default loop.
*
*/
function custom_home_genesis_meta() {
if ( is_active_sidebar( 'featured' ) || is_active_sidebar( 'home-middle-1' ) || is_active_sidebar( 'home-middle-2' ) || is_active_sidebar( 'home-middle-3' ) || is_active_sidebar( 'home-bottom-1' ) || is_active_sidebar( 'home-bottom-2' ) ) {
@cdils
cdils / extra-links.php
Last active February 13, 2018 06:19
This snippet can be added to single-listings.php (used with AgentPress Listings and the AgentPress theme to add some extra nav links above and below the single listing content. You'll need to add corresponding CSS to style the output.
@cdils
cdils / archive-portfolio.php
Created August 10, 2013 16:19
Register and display Portfolio CPT
<?php
/**
* The custom portfolio post type archive template
*/
/** Force full width content layout */
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
/** Remove the post info function */
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
@cdils
cdils / utility-widgets.php
Last active June 16, 2016 03:44
Add two widgetized areas above the header in Genesis.
/**
* Register Utility Bar Widget Areas.
*
* @author Carrie Dils
* @copyright Copyright (c) 2013, Carrie Dils
* @license GPL-2.0+
*/
genesis_register_sidebar( array(
'id' => 'utility-bar-left',
'name' => __( 'Utility Bar - Left', 'theme-prefix' ),
/* Utility Bar
--------------------------------------------- */
.utility-bar {
background-color: #333;
border-bottom: 1px solid #ddd;
color: #ddd;
font-size: 12px;
font-size: 1.2rem;
padding: 10px 0;