Skip to content

Instantly share code, notes, and snippets.

View bpmore's full-sized avatar

Brent Passmore bpmore

View GitHub Profile
@bpmore
bpmore / siteimprove
Created June 19, 2014 15:16
SiteImprove deep linking on Genesis
<?php
/*
Plugin Name: Get Page Id and Site URL
Description: Get the page id for SiteImprove Deep Linking
Version: 1
Author: Mark Heffington
Author URI: http://www.uca.edu/
*/
/*
Inside mu-plugins

Keybase proof

I hereby claim:

  • I am bpmore on github.
  • I am bpmore (https://keybase.io/bpmore) on keybase.
  • I have a public key whose fingerprint is ECE1 0D67 AADC F893 5DC8 29DE ADDF AE5D BEF3 EC42

To claim this, I am signing this object:

add_action( 'genesis_entry_content', 'os_show_featured_image_single_posts', 9 );
function os_show_featured_image_single_posts() {
global $post;
if ( ! is_singular( 'post' ) ) {
return;
}
// Get the featured image HTML

Keybase proof

I hereby claim:

  • I am bpmore on github.
  • I am bpmore (https://keybase.io/bpmore) on keybase.
  • I have a public key whose fingerprint is 416A D313 079B 83C9 253B 9D12 0CFA 44B8 E912 CD0E

To claim this, I am signing this object:

@bpmore
bpmore / atu-news
Last active August 29, 2015 14:17
ATU News 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/7/list-rss/no--filter.rss'); // specify the source feed
$limit = $feed->get_item_quantity(4); // 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 / array.txt
Created August 27, 2015 16:42
Function to print the $menu and $submenu array in WordPress.
//Found here: https://wordpress.org/support/topic/how-to-rename-the-admin-sub-menu-name-of-a-custom-post-category-or-tag
function wptutsplus_change_post_menu_label() {
global $menu;
global $submenu;
echo "<pre>";
print_r($menu);
print_r($submenu);
echo "</pre>";
}
add_action( 'admin_menu', 'wptutsplus_change_post_menu_label' );
@bpmore
bpmore / one
Created January 31, 2016 06:00
Verifying that +bpmore is my blockchain ID. https://onename.com/bpmore
@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' );
@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 / gmail-receipt-search
Created March 29, 2016 01:08
Search Gmail for Receipts within a Specific Year