Skip to content

Instantly share code, notes, and snippets.

@cdils
cdils / body-class-conditional.php
Created April 7, 2014 00:43
Use body class as a conditional
<?php //remove this line
function conditionl_widgets() {
$classes = get_body_class();
// If body class doesn't include 'full-width-content', BOUNCE
if in_array( 'full-width-content', $classes) {
return;
<?php
/**
* Template Name: Office Hours Template
* Description: Used as a page template to show page contents, followed by a loop
* through the "Genesis Office Hours" category
*/
// Add our custom loop
add_action( 'genesis_loop', 'cd_goh_loop' );
@cdils
cdils / colors.css
Last active April 16, 2019 02:02
Add support for additional color styles for Winning Agent Pro theme
/* Blue/Green
--------------------------------------------- */
.wap-blue .home-listings {
background-color: #e6e6e6;
}
.wap-blue .wap-community.entry img {
border: 10px solid #3d4d6d;
}
@cdils
cdils / custom_header.php
Created March 7, 2014 22:31
Code hijack from Genesis Framework functions/header.php genesis_do_header function.
<?php //ditch this entire line
remove_action( 'genesis_header', 'genesis_do_header' );
remove_action( 'genesis_header', 'brainfartin_do_header' );
function brainfartin_do_header() {
global $wp_registered_sidebars;
genesis_markup( array(
@cdils
cdils / search-bar.php
Last active August 29, 2015 13:56
Show the search bar on the home page only of the Winning Agent Pro Theme
<?php //remove opening php tag (this entire line)
// Add search widget below header
add_action( 'genesis_after_header', 'wap_search_bar' );
function wap_search_bar() {
if ( ! is_front_page() ) {
return;
}
@cdils
cdils / genesis-simple-sidebar-custom-post-type.php
Last active November 26, 2018 00:13
Use the Genesis Simple Sidebars plugin with a custom post type with the name 'wap-community'.
<?php //remove this line
// Add support for Genesis Simple Sidebars to Community post type
add_post_type_support( 'wap-community', 'genesis-simple-sidebars' );
@cdils
cdils / front-page.php
Created February 16, 2014 19:03
Front page for the Winning Agent Pro theme. http://demo.winningagent.com/winning-agent-pro-theme
<?php
/**
* This file adds the Home Page to the Winning Agent Pro Theme.
*
* @author Carrie Dils
* @package Winning Agent Pro
* @subpackage Customizations
*/
@cdils
cdils / genesis-site-title.php
Last active June 13, 2018 02:56
Filter the Genesis SEO Title to output with a custom class.
// Filter the title with a custom function
add_filter('genesis_seo_title', 'wap_site_title' );
// Add additional custom style to site header
function wap_site_title( $title ) {
// Change $custom_title text as you wish
$custom_title = '<span class="custom-title">WA</span>Estate';
// Don't change the rest of this on down
@cdils
cdils / 0_reuse_code.js
Created January 31, 2014 15:42
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@cdils
cdils / what-template-is-this.php
Created January 31, 2014 15:40
Figure out what template file is being used. Don't use on live sites. :)
<?php //remove opening tag
add_action( 'wp_head', 'show_template' );
function show_template() {
global $template;
print_r( $template );
}