Skip to content

Instantly share code, notes, and snippets.

@cdils
cdils / plugin-name.php
Created September 16, 2020 02:43
Alternative template path for Genesis Custom Blocks
<?php
/**
* Gets an alternate template path for Genesis Custom Blocks.
*
* This is handy if you want to include GCB blocks in a plugin versus your theme.
* @param string $path The template path.
* @return string An alternate template path.
*/
function ccb_get_alternate_template_path( $path ) {
@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 / editor-style.php
Last active March 27, 2020 05:49
Apply theme's stylesheet to the visual editor.
add_action( 'init', 'cd_add_editor_styles' );
/**
* Apply theme's stylesheet to the visual editor.
*
* @uses add_editor_style() Links a stylesheet to visual editor
* @uses get_stylesheet_uri() Returns URI of theme stylesheet
*/
function cd_add_editor_styles() {
add_editor_style( get_stylesheet_uri() );
@cdils
cdils / embed-form.php
Last active May 29, 2019 14:28
Add a Gravity Forms to a single AgentPress Listings post and dynamically populate the form with the post title. Add this to functions.php.
<?php //remove this line
/**
* Enqueue scripts for a specified Gravity Form (13 = ID) and then
* embed Gravity Form at the bottom of single property listings
*
* http://www.gravityhelp.com/documentation/page/Gform_enqueue_scripts
* http://www.gravityhelp.com/documentation/page/Embedding_A_Form#Function_Call
*
* @author Carrie Dils
@cdils
cdils / landing-page-template.php
Created November 19, 2013 13:53
Example of a Landing Page Template. Put this file in your child theme directory. To use it, create a page and set the template to "Landing."
<?php
/**
* This file adds the Landing template to the eleven40 Pro Theme.
*
* @author StudioPress
* @package Generate
* @subpackage Customizations
*/
/*
@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 / bbpress.scss
Last active January 21, 2019 21:21
This is quick, sassified version of the default bbPress stylesheet. I did not sassify the media queries at this point (I intend to re-work those as mobile-first for my project). Also note that I kept the original stylesheet organization. There's repition of some selectors that could be avoidded if the current organization was disregarded. :) As …
/**
* bbPress specific CSS
*
* @package bbPress
* @subpackage Theme
*/
/* =bbPress Style
-------------------------------------------------------------- */
@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(
<?php //remove this line
add_filter( 'simple_social_default_profiles', 'biw_add_new_simple_icon' );
/**
* Add Houzz icon to Simple Social Icons plugin.
*
* @param array $icons Social icons to include in widget options.
*
* @return array Updated icon set.
*/
@cdils
cdils / proper-table-markup.html
Last active December 9, 2018 00:41
Bootstrap table styles (See tutorial to add Bootstrap table styles to your theme -> https://carriedils.com/add-bootstrap-table-styles-theme/)
<!--
<thead> Groups the header content in a table
<th> Defines a header cell in a table
<tbody> Groups the body content in a table
<td> Defines a cell in a table
-->
<table>
<thead>