Skip to content

Instantly share code, notes, and snippets.


Kristen Symonds kristarella

View GitHub Profile
View wp-debug.php
define('WP_DEBUG', true);
if ( WP_DEBUG ) {
@error_reporting( E_ALL );
@ini_set( 'log_errors', true );
@ini_set( 'log_errors_max_len', '0' );
define( 'WP_DEBUG_LOG', true );
define('WP_DEBUG_DISPLAY', false);
kristarella / prettyphoto-activate.js
Created Jul 5, 2017
Activate prettyPhoto on WordPress images, even when image URLs have a query string.
View prettyphoto-activate.js
/* Add rel="lightbox" to image links if the lightbox is enabled */
if ( jQuery( 'body' ).hasClass( 'has-lightbox' ) && ! jQuery( 'body' ).hasClass( 'portfolio-component' ) ) {
jQuery( 'a[href*=".jpg"], a[href*=".jpeg"], a[href*=".gif"], a[href*=".png"]' ).each( function () {
var imageTitle = '';
if ( jQuery( this ).next().hasClass( 'wp-caption-text' ) ) {
imageTitle = jQuery( this ).next().text();
View 3-columns.html
<div style="width:30%;padding:0 3% 0 0;float:left;">
Your content for your column #1
Your content for your column #1
Your content for your column #1
<div style="width:30%;padding:0 3% 0 0;float:left;">
Your content for your column #2
Your content for your column #2
Your content for your column #2
View alphabet-index.html
<li><a href="#a">A</a></li>
<li><a href="#b">B</a></li>
<li><a href="#c">C</a></li>
<li><a href="#d">D</a></li>
<li><a href="#e">E</a></li>
<li><a href="#f">F</a></li>
<li><a href="#g">G</a></li>
<li><a href="#h">H</a></li>
<li><a href="#i">I</a></li>
View YouTube-caption.html
<div class="blue">
<p>Caption goes here.</p>
kristarella / gform_acf.php
Created Apr 29, 2015
Convert Gravity Form multiselects to ACF format
View gform_acf.php
add_action('gform_after_submission_14', 'reformat_multiselect', 10, 2);
function reformat_multiselect($entry, $form) {
$post_id = $entry['post_id'];
$selects = array(
'custom_field1' => 'ACF_field_key',
'custom_field2' => 'ACF_field_key',
'custom_field3' => 'ACF_field_key'
kristarella / results-page.html
Last active Jul 8, 2017
Code required for WP Ultimate Search radius search: results-page is the contents of the WordPress page, search.js needs to be included somewhere on the page, and the results template goes in your theme.
View results-page.html
Choose "location" from the search bar below and type your location in order to find Bushcare sites near you.
The default distance is 15km, but you can specify your own.
<div id="map-results" class="acf-map"></div>
kristarella / add_menu_item.php
Created Mar 18, 2014
Add items to a WordPress menu.
View add_menu_item.php
// Filter wp_nav_menu() to add additional links and other output
add_filter( 'wp_nav_menu_menu-name_items', 'new_nav_menu_items' );
function new_nav_menu_items($items) {
$homelink = '<li class="menu-item home"><a href="' . home_url( '/' ) . '">' . __('Home') . '</a></li>';
$items = $homelink . $items;
return $items;
kristarella / author_box-style.css
Created Jan 21, 2014
Enables the author box on single post pages and adds a list of related posts (by author, category & year) to the author box.
View author_box-style.css
.author-box h2.related {
font-size: 1rem;
padding-top: 0.5em;
clear: both;
.author-box ul.related {
margin-left: 2rem;
.author-box ul.related .date {
kristarella / clear_float.css
Last active Jan 3, 2016
Cause following or parent elements to clear float
View clear_float.css
:after {
You can’t perform that action at this time.