Skip to content

Instantly share code, notes, and snippets.

View bpmore's full-sized avatar

Brent Passmore bpmore

View GitHub Profile
@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 / 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 / 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 / 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 / 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();
//* 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 / 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 () {
@bpmore
bpmore / events-widgets.php
Created August 2, 2016 18:56 — forked from tomfinitely/events-widgets.php
The Events Calendar Pro - Cross-site Events Widget
<?php
if ( ! defined( 'ABSPATH' ) ) die('-1');
/*
* WDG-customized version of the Events Calendar Pro mini calendar widget.
* Changes are noted inline.
* Replacing class name: TribeEventsMiniCalendarWidget
*/
class MultisiteTribeEventsMiniCalendarWidget extends WP_Widget {
function __construct() {
@bpmore
bpmore / brown-august10.css
Last active August 10, 2016 14:21
Brown Original CSS
body {
font-family: 'Merriweather', serif;
font-weight: 400;
font-style: normal;
}
.et_pb_gutters1 .et_pb_column .et_pb_module {
border: 1px solid #eee;
}
@bpmore
bpmore / gf-cal
Last active August 6, 2019 04:25
gravity forms calendar picker
Make the date picker start 2 weeks from current date.
Find this in your form:
<input name="input_26" id="input_2_26" type="text" value="" class="datepicker medium mdy datepicker_with_icon hasDatepicker">
The id above equals the formID and fieldID below.
<script type="text/javascript">
gform.addFilter( 'gform_datepicker_options_pre_init', function( optionsObj, formId, fieldId ) {
if ( formId == 2 && fieldId == 26 ) {