Skip to content

Instantly share code, notes, and snippets.

View butlerblog's full-sized avatar

Chad Butler butlerblog

View GitHub Profile
@bekarice
bekarice / wc-align-cart-buttons.css
Created October 2, 2014 23:44
Align WooCommerce Add to Cart Buttons (MAY CHANGE WITH THEME)
a.added_to_cart.wc-forward {
bottom: 0;
position: absolute;
display: block;
bottom: 0px;
}
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
min-height: 295px !important;
@bekarice
bekarice / heading-shortcode.php
Last active February 4, 2019 23:18
Shortcode: Create Headings with anchor + link icon
<?php // only copy this line if needed!
// REQUIRES PHP 5.3+
/**
* Create a shortcode to insert a header with an anchor icon.
* Use [heading size="2" id="anchor"]Heading[/heading]
*
* Recommended: Add prefix / change shortcode name to avoid conflicts
*/
@bordoni
bordoni / mailpoet-insert_new_user.php
Last active March 18, 2018 23:27
Insert a new user to MailPoet and handle custom fields
<?php
// The ID of the lists you want to add a user to
$list_ids = array( 1 );
// User Data without the custom fields
$data_subscriber = array(
'user' => array(
'email' => '[email protected]',
'firstname' => 'John',
'lastname' => 'Doe',
@bekarice
bekarice / tab-manager-third-party-tabs.php
Last active November 17, 2018 22:11
Tab Manager Third Party Compat
function third_party_tab( $tabs ) {
global $product;
$some_check = $product ? third_party_check( $product->id ) : null;
if ( $product && ! $some_check ) {
return $tabs;
}
$tabs['third_party_tab'] = array(
@komuw
komuw / how to properly install virtualbox on chromebook
Last active January 30, 2025 03:48
how to properly install virtualbox on chromebook.
Taken from:https://github.com/dnschneid/crouton/wiki/Build-kernel-headers-and-install-Virtualbox-(x86)
https://github.com/dnschneid/crouton/wiki/Build-kernel-headers-and-install-Virtualbox-(x86)
only pasted here so I can be sure I will always have it.
NB: do this ALTERNATIVE INSTEAD(it solves multi reboots on vagrant up)
1. build kernel headers as per this diff method: https://github.com/divx118/crouton-packages/blob/master/README.md
ie: from a shell in ua chroot(ubuntu)
$ cd ~
$ wget https://raw.githubusercontent.com/divx118/crouton-packages/master/setup-headers.sh
@ericjuden
ericjuden / wordpress-options-json.php
Last active June 30, 2022 12:33
WordPress Options Class with Support for storing and retrieving JSON
<?php
class My_Plugin_Options {
var $options;
var $option_name;
var $is_site_option; // Are we using Multisite and saving to global options?
function My_Plugin_Options($option_name, $is_site_options = false){
$this->option_name = $option_name;
$this->is_site_option = $is_site_options;
if($this->is_site_option){
@srikat
srikat / parallax.js
Last active April 9, 2019 16:23
Applying Parallax effect from Parallax Pro in any Genesis theme. http://sridharkatakam.com/apply-parallax-effect-parallax-pro-genesis-theme/
//* Register widget areas
genesis_register_sidebar( array(
'id' => 'parallax-section-below-header',
'name' => __( 'Parallax Section Below Header', 'your-theme-slug' ),
'description' => __( 'This is the parallax section below header.', 'your-theme-slug' ),
) );
genesis_register_sidebar( array(
'id' => 'parallax-section-above-footer',
'name' => __( 'Parallax Section Above Footer', 'your-theme-slug' ),
@paulund
paulund / example-wp-list-table.php
Last active January 28, 2025 16:01
An example code of using the WP_List_Table class. With Pagination.
<?php
/*
* Plugin Name: Paulund WP List Table Example
* Description: An example of how to use the WP_List_Table class to display data in your WordPress Admin area
* Plugin URI: http://www.paulund.co.uk
* Author: Paul Underwood
* Author URI: http://www.paulund.co.uk
* Version: 1.0
* License: GPL2
*/
@llbbl
llbbl / awesome-php.md
Last active April 1, 2025 10:38 — forked from ziadoz/awesome-php.md
Awesome PHP Libraries and Resources

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Categories

  • Composer
  • Composer Related
  • Frameworks
  • Micro Frameworks
@johnpolacek
johnpolacek / gist:3827270
Last active January 20, 2023 15:46
Prevent FOUC
<!-- Prevent FOUC (flash of unstyled content) - http://johnpolacek.com/2012/10/03/help-prevent-fouc/ -->
<style type="text/css">
.no-fouc {display: none;}
</style>
<script type="text/javascript">
document.documentElement.className = 'no-fouc';
// add to document ready: $('.no-fouc').removeClass('no-fouc');
</script>