Skip to content

Instantly share code, notes, and snippets.

Avatar

Rob Neu robneu

View GitHub Profile
@robneu
robneu / time.php
Last active Mar 25, 2017 — forked from gleddy/time.php
cookbook snippet
View time.php
// customize single post header content for dx5
add_action( 'genesis_entry_header', 'dx5_do_post_header');
function dx5_do_post_header() {
genesis_markup( array(
'html5' => '<header %s>',
'context' => 'dx5-post-heading',
) );
@robneu
robneu / cookbook-print.php
Last active Feb 10, 2017
Add custom inline styles to the Cookbook print/print preview.
View cookbook-print.php
<?php
add_action( 'cookbook_recipe_print_head', 'prefix_cookbook_inline_print_css', 99 );
/**
* Inline custom print styles in the Cookbook print head.
*
* @since 1.0.0
* @access public
* @return void
*/
View .htaccess
# BEGIN serve images from production
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^(.*\.(js|css|png|jpe?g|gif|ico|svg)) http://example.com/$1 [NC,P,L]
</IfModule>
# END serve images from production
@robneu
robneu / cookbook-image-size.php
Created Jan 18, 2017
Modify the default recipe image size in Cookbook.
View cookbook-image-size.php
<?php
add_filter( 'cookbook_recipe_image_size', 'prefix_get_recipe_image_size' );
/**
* Modify the default cookbook recipe image size.
*
* @since 1.0.0
* @param string $size The current image size.
* @return string
*/
@robneu
robneu / cookbook-template-strings.php
Last active Jan 17, 2017
Change the default template strings in Cookbook for WordPress
View cookbook-template-strings.php
<?php
add_filter( 'cookbook_strings', 'prefix_custom_strings' );
/**
* Modify the default template strings in Cookbook.
*
* @since 1.0.0
* @param array $strings The default template strings.
* @return array
*/
@robneu
robneu / debug-log.php
Created Sep 29, 2016
Write a debug log to the WP uploads directory. Use tail -f in a terminal to watch for changes on the fly
View debug-log.php
<?php
/**
* Write a debug log.
*
* @param mixed $msg A message to log.
*/
function sitecare_debug_log( $msg = null ) {
if ( ! is_string( $msg ) ) {
$msg = print_r( $msg, true );
@robneu
robneu / facet-wp-infinite-scroll.js
Last active Apr 8, 2019
Infinite scroll for FacetWP
View facet-wp-infinite-scroll.js
/* globals FWP */
/**
* JavaScript for FacetWP Infinite Scroll
*/
(function( $ ) {
'use-strict';
var throttleTimer = null;
var throttleDelay = 100;
View wp-featherlight-disable-woocommerce.php
<?php
add_action( 'wp_enqueue_scripts', 'prefix_disable_wp_featherlight_woocommerce', 10 );
/**
* Remove all required scripts and styles on WooCommerce pages.
*
* @since 0.1.0
* @access public
* @return void
*/
function prefix_disable_wp_featherlight_woocommerce() {
@robneu
robneu / video-embed.html
Last active Mar 23, 2018
Embed a YouTube video using featherlight.js
View video-embed.html
<a href="https://www.youtube.com/embed/CEYRBTZWu8U" data-featherlight="iframe" data-featherlight-iframe-width="960" data-featherlight-iframe-height="540">
<img class="alignnone" src="http://img.youtube.com/vi/CEYRBTZWu8U/maxresdefault.jpg" alt="" width="1280" height="720" />
</a>
View shitty-pluggable-function.php
<?php
if ( ! function_exists( 'shitty_pluggable_function' ) ) {
function shitty_pluggable_function() {
echo 'I am a piece of shit and I wish I was never created';
}
}
You can’t perform that action at this time.