Skip to content

Instantly share code, notes, and snippets.

View kristarella's full-sized avatar

Kristen Symonds kristarella

View GitHub Profile
@kristarella
kristarella / genesis_grid_loop.php
Last active January 3, 2016 12:49
Grid loop for homepage (with HTML 5 removal of post footer).
<?php
//* Remove the post meta function for front page only
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
//* Add support for Genesis Grid Loop
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'child_grid_loop_helper' );
function child_grid_loop_helper() {
if ( function_exists( 'genesis_grid_loop' ) ) {
@kristarella
kristarella / genesis_backtotop.php
Created January 16, 2014 22:47
Back to top link that works in Genesis HTML5 framework
<?php
// custom header ID for backtotop
add_filter('genesis_attr_site-header','mytheme_header_id',1);
function mytheme_header_id($atts) {
$atts['id'] = "header";
return $atts;
}
// back to top link
@kristarella
kristarella / nav_menu.css
Created January 19, 2014 08:08
Mobile menu for Genesis
@media only screen and (max-width: 664px) {
.mobile_menu {
display: block;
width: 90%;
margin-left: auto;
margin-right: auto;
padding: 5px 20px;
padding: 0.5rem 2rem;
cursor: pointer;
@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;
}
@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 / 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 / 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 / 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'
<div class="blue">
YOUTUBE_URL
<p>Caption goes here.</p>
</div>
<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>