Skip to content

Instantly share code, notes, and snippets.

View bpmore's full-sized avatar

Brent Passmore bpmore

View GitHub Profile
@bpmore
bpmore / sort-tabs.txt
Created June 9, 2016 17:41
Sort Tabs in Google Spreadsheets
1. Copy/Paste the information below to the clipboard
2. Open the spreadsheet whose sheets need to be alphabetised
3. Choose Tools > Script editor > Blank (this opens a new tab in the browser)
4. Press Control+A followed by Control+V copy and paste the script in
5. Press Control+S to save the script
6. Choose Run > sortSheets
7. Go back to the spreadsheet tab to view the new sorted tab order
--Copy everything below this line--
function sortSheets () {
//* Display Parent and Child Page Titles on Page
add_filter( 'genesis_post_title_output', 'lit_post_title_output', 15 );
function lit_post_title_output( $title ) {
global $post;
// if ( is_page() && $post->post_parent > 0 ) {
if( is_page( array( 'northwest', 'west', 'south-central' ))) {
$parent_title = get_the_title();
$page_title = get_the_title();
@bpmore
bpmore / parent-child-titles.php
Last active June 2, 2016 19:35
Display Parent and Child Page Titles on Page
//* Display Parent and Child Page Titles on Page
add_filter( 'genesis_post_title_output', 'lit_post_title_output', 15 );
function lit_post_title_output( $title ) {
global $post;
if ( is_page() && $post->post_parent > 0 ) {
$parent_title = get_the_title( $post->post_parent );
$page_title = get_the_title();
@bpmore
bpmore / image_on_top.php
Last active June 2, 2016 14:06
Display Featured Image on top of post in GenesisWP
/* Code to Display Featured Image on top of the post */
add_action( 'genesis_entry_content', 'featured_post_image', 8 );
function featured_post_image() {
if ( !is_singular( array( 'post', 'page' ) )) return;
the_post_thumbnail('large'); //you can use medium, large or a custom size
}
@bpmore
bpmore / multiple-instance-genesis-slider.php
Created June 1, 2016 20:11
Multiple instances of Genesis Responsive Slider
# Allow multiple instances of Genesis Responsive Slider
add_action ('wp', 'lit_custom_slide_show');
function lit_custom_slide_show() {
if(is_home()){
$category_prefix = ""; // Home page needs no prefix
} else {
$category_prefix = basename(get_permalink()).'-' ; // this results in ‘about-‘ for a page called “about”
}
$my_posts_term = 'category_name,'.$category_prefix.'featured'; // Prefix matches category used for home page
@bpmore
bpmore / video-wrapper.css
Created May 6, 2016 21:04
Video Wrapper 100%
/* Video Wrapper
------------------------------------------------------------ */
.videoWrapper {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
height: 0;
}
.videoWrapper iframe {
@bpmore
bpmore / full-width-slider.css
Created April 27, 2016 20:00
Full width slider on Education Pro theme
.education-pro-home #genesis-responsive-slider {
max-width: 100%;
border: none;
padding: 0;
}
.education-pro-home .flexslider {
max-width: 100%;
}
@bpmore
bpmore / gmail-receipt-search
Created March 29, 2016 01:08
Search Gmail for Receipts within a Specific Year
@bpmore
bpmore / atu-cal-feed.php
Created March 25, 2016 19:47
ATU Calendar Feed
<?php
if (function_exists('fetch_feed')) {
include_once(ABSPATH . WPINC . '/feed.php'); // include the required file
$feed = fetch_feed('http://69.65.177.39/webcache/v1.0/rssDays/2/list-rss/no--filter.rss'); // specify the source feed
$limit = $feed->get_item_quantity(8); // specify number of items
$items = $feed->get_items(0, $limit); // create an array of items
$items = array_reverse($items); // display the sort correctly
$feed->set_cache_duration(43200); // cache the feed 43200=12 hours
@bpmore
bpmore / linkify-gravity-view.php
Created March 17, 2016 20:51
Makes Linkify Text plugin and Gravity View plugin work together
/**
* Makes Linkify Text work with Gravity View to link school to URL
*/
function more_text_replacements( $filters ) {
$filters[] = 'gravityview_field_output';
return $filters;
}
add_filter( 'c2c_linkify_text_filters', 'more_text_replacements' );