Skip to content

Instantly share code, notes, and snippets.

@bryanwillis
bryanwillis / functions.php
Created November 15, 2015 21:20 — forked from mafsdisseny/functions.php
Add genesis-structural-wrap and filter it through a template
<?php
// First we include it in the genesis-structural-wrap genesis declaration
add_theme_support( 'genesis-structural-wraps', array(
'header',
// 'nav',
// 'subnav',
'site-inner',
'footer-widgets',
'page-header-img', //here is it
'footer'
@bryanwillis
bryanwillis / wordpress-hide-editor-on-pages.php
Last active September 11, 2015 06:21 — forked from atomtigerzoo/wordpress-hide-editor-on-pages.php
Wordpress: Hide the editor on defined pages
/**
* Hide the main editor on specific pages
*/
define('EDITOR_HIDE_PAGE_TITLES', json_encode(array()));
define('EDITOR_HIDE_PAGE_TEMPLATES', json_encode(array('template-cars.php')));
/**
* Hide the main editor on defined pages
*
@bryanwillis
bryanwillis / gist:a1e8cbfc5e9211b1896f
Last active August 29, 2015 14:25 — forked from johnmorris/gist:5245822
Hijacking WordPress menus using wp_nav_menu_objects
if ( !class_exists( 'HijackMe' ) ) {
class HijackMe {
public function hijack_menu($objects) {
/**
* If user isn't logged in, we return the link as normal
*/
if ( !is_user_logged_in() ) {
return $objects;
}
/**
@bryanwillis
bryanwillis / functions.php
Last active August 29, 2015 14:25 — forked from levymetal/direct_parent.php
Custom Wordpress function which uses a nav walker to display a list of child pages from a common parent, which can be called from either the parent page (displays children) or any of the child pages (displays siblings). Detailed instructions available on my blog post here: http://christianvarga.com/how-to-get-submenu-items-from-a-wordpress-menu-…
<?php
// add hook
add_filter( 'wp_nav_menu_objects', 'my_wp_nav_menu_objects_sub_menu', 10, 2 );
// filter_hook function to react on sub_menu flag
function my_wp_nav_menu_objects_sub_menu( $sorted_menu_items, $args ) {
if ( isset( $args->sub_menu ) ) {
$root_id = 0;
@bryanwillis
bryanwillis / EaRPjN.markdown
Last active August 29, 2015 14:16 — forked from anonymous/EaRPjN.markdown
Trying to figure out bootstrap less media queries
tell application "Evernote"
set _selectedNote to false
set _notes to get every note of every notebook where its title contains "TARGETNOTE"
repeat with _note in _notes
if length of _note is not 0 then
set _selectedNote to _note
end if
end repeat
tell item 1 of _selectedNote to append text return & return & date string of (current date) & time string of (current date) & return
tell item 1 of _selectedNote to append attachment theFile

I have spent quite a bit of time figuring out automounts of NFS shares in OS X...

Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:

/etc/auto_master (see last line):

#
# Automounter master map
#

+auto_master # Use directory service

<?php
add_filter( 'genesis_attr_movie', 'custom_add_movie_attr' );
/**
* Callback for dynamic Genesis 'genesis_attr_$context' filter.
*
* Add custom attributes for the custom filter.
*
* @param array $attributes The element attributes
* @return array $attributes The element attributes
//* Reposition the footer widgets
remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );
add_action( 'genesis_after', 'genesis_footer_widget_areas' );
//* Reposition the footer
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 );
remove_action( 'genesis_footer', 'genesis_do_footer' );
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 );
add_action( 'genesis_after', 'genesis_footer_markup_open', 11 );
add_action( 'genesis_after', 'genesis_do_footer', 12 );
<?php
/**
* Plugin installation and activation for WordPress themes.
*
* @package TGM-Plugin-Activation
* @version 2.4.0@version 2.4.0
* @author Thomas Griffin <thomasgriffinmedia.com>
* @author Gary Jones <gamajo.com>
* @copyright Copyright (c) 2012, Thomas Griffin
* @license http://opensource.org/licenses/gpl-2.0.php GPL v2 or later