Skip to content

Instantly share code, notes, and snippets.

View oneblackcrayon's full-sized avatar

Frederick Polk oneblackcrayon

View GitHub Profile
@oneblackcrayon
oneblackcrayon / simple_copyright.php
Created August 18, 2016 03:48 — forked from onishiweb/simple_copyright.php
A simple copyright text generator for WordPress
@oneblackcrayon
oneblackcrayon / WordPress - Auto Copyright.php
Created August 18, 2016 03:47
WordPress Auto Copyright
@oneblackcrayon
oneblackcrayon / bloginfo-as-shortcode.php
Created August 18, 2016 02:07
Display the site name and other bloginfo callable info as shortcode
<?php
/**
* Plugin Name: Bloginfo Shortcode
* Description: Allows bloginfo() as a shortcode.
* Author: Giuseppe Mazzapica
* Author URI: http://gm.zoomlab.it
* License: MIT
* @link: http://wordpress.stackexchange.com/questions/173871/how-to-display-the-site-name-in-a-wordpress-page-or-post
*/
@oneblackcrayon
oneblackcrayon / woocommerce-acf-create-own-product-tabs-and-fields-for-editable-tab-content-with-plugin-acf.php
Created July 7, 2016 15:25
Create own product tabs and fields for editable Tab content with plugin ACF
/**
* Create own product tabs and fields for editable Tab content with plugin ACF
* @Link: https://gist.github.com/webonaut/85622efe2b818e2d1442
*/
/// CREATE TABS
add_filter( 'woocommerce_product_tabs', 'oxx_product_detail_tab', 97 );
function oxx_product_detail_tab( $tabs ) {
// Adds the new tab "Details"
@oneblackcrayon
oneblackcrayon / functions.php
Created April 21, 2016 01:37
Disable/Remove WooCommerce 2.0+ generator tag, styles, and scripts from all areas other than store.
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
if ( is_woocommerce() || is_page('store') || is_shop() || is_product_category() || is_product() || is_cart() || is_checkout() ) {
wp_dequeue_style( 'woocommerce_frontend_styles' );
wp_dequeue_style( 'woocommerce_fancybox_styles' );
wp_dequeue_style( 'woocommerce_chosen_styles' );
wp_dequeue_style( 'woocommerce_prettyPhoto_css' );
wp_dequeue_script( 'wc_price_slider' );
wp_dequeue_script( 'wc-single-product' );
@oneblackcrayon
oneblackcrayon / functions.php
Created April 21, 2016 01:28
Soliloquy: Completely bypass output into a slider. Simply use Soliloquy for the UI and then do something completely different with it. And here is how you do it. Using this filter will completely disable any slider output, including CSS and JS files and initializations. It gives you a blank slate with nothing but raw images (in the $images array…
add_filter( 'tgmsp_pre_load_slider', 'tgm_soliloquy_transform_to_gallery', 10, 5 );
/**
* Circumvents the slider output and allows access to raw format.
*
* @param bool $bool Boolen if the filter should be run. Default is false.
* @param int $id The slider ID being filtered.
* @param array $images Array of images in the slider.
* @param array $data Array of meta for the slider.
* @param int $count The current number of the slider on page (if there is more than one on the page).
* @return bool|string False if you want to keep a slider, HTML output for something else.
@oneblackcrayon
oneblackcrayon / high-dpi-media.css
Created April 20, 2016 05:26 — forked from marcedwards/high-dpi-media.css
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@oneblackcrayon
oneblackcrayon / hovernav.css
Created March 30, 2016 23:18 — forked from SimonPadbury/hovernav.css
This is a simple supplement for Bootstrap 3 to transform the navbar so that the dropdown menu appears on hover instead of on click. No need to modify the Bootstrap 3 js or css at all – simply add this js and css below to your js and css files that are <head> linked *after* the Bootstrap 3 js and css files. Styles for both .navbar-default and .na…
/*
Navbar "hovernav" dropdown menu - this works only for screen sizes larger than phones.
The Bootstrap CSS is unchanged.
*/
@media (min-width: 768px) {
/* Use this if you wish to hide the caret
.navbar-nav .caret {
display: none;
}
*/
@oneblackcrayon
oneblackcrayon / centering-gravity-forms-mailchimp-signup-form.css
Created March 11, 2016 04:26
Centering a Gravity Forms powered, MailChimp signup form.
/* Centering a Gravity Forms powered, MailChimp signup form. */
#gform_wrapper_1 { margin: 0; padding: 0; }
#gform_wrapper_1 #gform_1 { text-align: center; width: 100%; }
#gform_wrapper_1 .gform_body,
#gform_wrapper_1 .gform_footer { clear: none; display: inline-block; margin: 0; padding: 0; vertical-align: bottom; }
#gform_wrapper_1 .gform_body { width: 70%; }
#gform_wrapper_1 .gform_footer { margin-left: -5px; width: auto; }
#gform_wrapper_1 .gform_footer input { padding: 10px 22px; }
#gform_wrapper_1 #gform_1 ul li.gfield { margin-bottom: 0; padding: 0; }
#gform_wrapper_1 #gform_1 label.gfield_label+div.ginput_container { margin-top: 0; }
@oneblackcrayon
oneblackcrayon / wp-menus-as-shortcode.php
Created February 25, 2016 04:48
Menus in a shortcode
<?php
Author URI: http://www.basvanderlans.nl
*/
/**
* Adds the possibility to callback Custom Menus by a Shortcode
*
* @author Bas van der Lans
* @copyright based on a snippet by Cozmoslabs: http://www.cozmoslabs.com/1170-wp_nav_menu-shortcode/