Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View kristarella's full-sized avatar

Kristen Symonds kristarella

View GitHub Profile
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
kristarella / prettyphoto-activate.js
Created July 5, 2017 05:27
Activate prettyPhoto on WordPress images, even when image URLs have a query string.
jQuery(document).ready(function(){
/*-----------------------------------------------------------------------------------*/
/* 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();
<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>
<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
<ul>
<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>
<div class="blue">
YOUTUBE_URL
<p>Caption goes here.</p>
</div>
@kristarella
kristarella / gform_acf.php
Created April 29, 2015 01:36
Convert Gravity Form multiselects to ACF format
<?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
kristarella / results-page.html
Last active July 8, 2017 01:09
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.
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>
[wp-ultimate-search-bar]
[wp-ultimate-search-results]
@kristarella
kristarella / add_menu_item.php
Created March 18, 2014 05:31
Add items to a WordPress menu.
// 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
kristarella / author_box-style.css
Created January 21, 2014 12:49
Enables the author box on single post pages and adds a list of related posts (by author, category & year) to the author box.
.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
kristarella / clear_float.css
Last active January 3, 2016 23:49
Cause following or parent elements to clear float
:after {
content:".";
display:block;
height:0;
clear:both;
visibility:hidden;
}