Skip to content

Instantly share code, notes, and snippets.

Avatar

Carrie Dils cdils

View GitHub Profile
@cdils
cdils / gutenberg-style.css
Created May 9, 2018
This is an unminified version of the stylesheet that ships with the WordPress Gutenberg plugin. Original SCSS files are here -> https://github.com/WordPress/gutenberg/tree/master/core-blocks
View gutenberg-style.css
.wp-block-embed figcaption {
margin-top: .5em;
color: #6c7781;
text-align: center;
font-size: 13px
}
.editor-block-list__block[data-type="core/embed"][data-align=left] .editor-block-list__block-edit,
.editor-block-list__block[data-type="core/embed"][data-align=right] .editor-block-list__block-edit,
.wp-block-embed.alignleft,
@cdils
cdils / comment-notes-before.php
Last active Nov 27, 2020
Customize the text before the comment form in WordPress. Note: Logged in users will not see this text.
View comment-notes-before.php
<?php //remove this line
add_filter( 'comment_form_defaults', 'cd_pre_comment_text' );
/**
* Change the text output that appears before the comment form
* Note: Logged in user will not see this text.
*
* @author Carrie Dils <http://www.carriedils.com>
* @uses comment_notes_before <http://codex.wordpress.org/Function_Reference/comment_form>
*
@cdils
cdils / plugin-name.php
Created Sep 16, 2020
Alternative template path for Genesis Custom Blocks
View plugin-name.php
<?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 Mar 13, 2013
Testimonial Archive Template
View archive-testimonials.php
<?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 Mar 27, 2020
Apply theme's stylesheet to the visual editor.
View editor-style.php
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 / change-style-load-order.php
Last active Mar 20, 2020
Change order of where Genesis child theme stylesheet is loaded on theme initialization.
View change-style-load-order.php
<?php //Remove this line
/**
* Remove Genesis child theme style sheet
* @uses genesis_meta <genesis/lib/css/load-styles.php>
*/
remove_action( 'genesis_meta', 'genesis_load_stylesheet' );
/**
* Enqueue Genesis child theme style sheet at higher priority
@cdils
cdils / embed-form.php
Last active May 29, 2019
Add a Gravity Forms to a single AgentPress Listings post and dynamically populate the form with the post title. Add this to functions.php.
View embed-form.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 Nov 19, 2013
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."
View landing-page-template.php
<?php
/**
* This file adds the Landing template to the eleven40 Pro Theme.
*
* @author StudioPress
* @package Generate
* @subpackage Customizations
*/
/*
@cdils
cdils / colors.css
Last active Apr 16, 2019
Add support for additional color styles for Winning Agent Pro theme
View colors.css
/* Blue/Green
--------------------------------------------- */
.wap-blue .home-listings {
background-color: #e6e6e6;
}
.wap-blue .wap-community.entry img {
border: 10px solid #3d4d6d;
}
@cdils
cdils / archive-testimonials.php
Last active Mar 16, 2019
This is code for a custom page template removing the standard Genesis loop and inserting a custom loop. Similar to https://gist.github.com/4684423.js, but without a grid loop.
View archive-testimonials.php
<?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_loop' ); // Add custom loop