Skip to content

Instantly share code, notes, and snippets.

@jeffreyd00
jeffreyd00 / functions.php
Created September 28, 2015 17:59 — forked from srikat/functions.php
Full width header with logo at left and navigation at right in Dynamik. http://sridharkatakam.com/full-width-header-logo-left-navigation-right-dynamik/
/**********************************
*
* Replace Header Site Title with Inline Logo
* Fix Genesis bug - when using static front page and blog page (admin reading settings) Home page is <p> tag and Blog page is <h1> tag
* Replace "is_home" with "is_front_page" to correctly display Home page wit <h1> tag and Blog page with <p> tag
*
* @author AlphaBlossom / Tony Eppright
* @link http://www.alphablossom.com
*
************************************/
/* Search WP Functions
----------------------------------------------------------- */
/* includes search terms that are close in spelling to those indexed */
function my_fuzzy_word_length()
{
return 4;
}
add_filter( 'searchwp_fuzzy_min_length', 'my_fuzzy_word_length' );
//* Make Font Awesome available
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
function enqueue_font_awesome() {
wp_enqueue_style( 'font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css' );
}
//* Customize search form input box text
add_filter( 'genesis_search_text', 'sp_search_text' );
@jeffreyd00
jeffreyd00 / functions.php
Last active August 29, 2015 14:28 — forked from jnicol/functions.php
Sanitize WordPress filenames on upload
/**
* WordPress allows UTF8 characters such as copyright symbol in filenames but these break in Safari
*
* @see https://wordpress.org/support/topic/uploaded-image-with-accents-in-name-image-dont-show-in-safari-6 for original function
* @see https://core.trac.wordpress.org/ticket/22363 for progress on fixing this bug
*
* #wordpress
*/
function sanitize_filename_on_upload($filename) {
$ext = end(explode('.',$filename));
<?php
//* Remove breadcrumbs
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
//* Force full width content
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
//* Remove entry meta in entry header
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
@jeffreyd00
jeffreyd00 / functions.php
Created July 10, 2015 14:46 — forked from andrewspear/functions.php
Ping Facebook with (via a POST request) to refresh the cache (scrape) for a scheduled post as it is published
<?
// Ping Facebook with (via a POST request) to refresh the cache (scrape) for a scheduled post as it is published
// Relevant docs: https://developers.facebook.com/docs/opengraph/using-objects#selfhosted-update
// Place this in your Wordpress functions.php file
// https://gist.github.com/andrewspear/3d9015b1c1d652b4a862
// Credit Andrew Spear
add_action('transition_post_status', 'purge_future_post', 10, 3);
@jeffreyd00
jeffreyd00 / gist:fed7606c1d7e47685ecf
Created June 22, 2015 13:44
List of states in the United States for ACF
AL : Alabama
AK : Alaska
AZ : Arizona
AR : Arkansas
CA : California
CO : Colorado
CT : Connecticut
DE : Delaware
DC : District of Columbia
FL : Florida
@jeffreyd00
jeffreyd00 / gist:499d27b9bc5c483985aa
Last active August 29, 2015 14:15 — forked from tomhemsley/gist:c7f13eafa3b28833f078
Meta Slider Video Background with Poster Image Support
function add_poster_to_video( $atts, $slide_id, $slider_id, $settings, $url ) {
$atts['poster'] = $url;
// unset($atts['autoplay']); // this stop video auto playing - remove this when site goes live
return $atts;
}
add_filter('metaslider_layer_video_attributes','add_poster_to_video', 10, 5);
<?php
//* Add class to .content
add_filter( 'genesis_attr_content', 'beatm_facetwp_class' );
function beatm_facetwp_class( $attributes ) {
$attributes['class'] = $attributes['class']. ' facetwp-template';
return $attributes;
}