Skip to content

Instantly share code, notes, and snippets.

View nikcree's full-sized avatar

Nik Cree nikcree

View GitHub Profile
@rutger1140
rutger1140 / gist:4994751
Created February 20, 2013 10:55
Gravity Forms hook - disable auto scrolling to anchor after submit
// Gravity Forms anchor - disable auto scrolling of forms
add_filter("gform_confirmation_anchor", create_function("","return false;"));
@justintadlock
justintadlock / register-post-type.php
Last active January 8, 2025 22:04
Help file when registering post types.
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public
@cdils
cdils / landing-page-template.php
Created November 19, 2013 13:53
Example of a Landing Page Template. Put this file in your child theme directory. To use it, create a page and set the template to "Landing."
<?php
/**
* This file adds the Landing template to the eleven40 Pro Theme.
*
* @author StudioPress
* @package Generate
* @subpackage Customizations
*/
/*
@kristarella
kristarella / genesis_header_image.php
Created January 16, 2014 06:21
Genesis child theme: use an HTML image for your custom header image instead of CSS background.
<?php
$header = array(
'default-image' => get_stylesheet_directory_uri().'/images/pageone.png',
'random-default' => false,
'width' => 320,
'height' => 60,
'flex-height' => true,
'flex-width' => true,
'default-text-color' => '#333333',
@cdils
cdils / genesis-site-title.php
Last active June 13, 2018 02:56
Filter the Genesis SEO Title to output with a custom class.
// Filter the title with a custom function
add_filter('genesis_seo_title', 'wap_site_title' );
// Add additional custom style to site header
function wap_site_title( $title ) {
// Change $custom_title text as you wish
$custom_title = '<span class="custom-title">WA</span>Estate';
// Don't change the rest of this on down
@richardW8k
richardW8k / RW_Delete_Entry.php
Last active January 20, 2022 07:21
When placed in the theme functions.php file this will add a checkbox to the 'Form Options' part of the Form Settings page which when checked will cause entries to be automatically deleted at the end of the submission process.
<?php
class RW_Delete_Entry {
function __construct() {
if( ! property_exists( 'GFCommon', 'version' ) || ! version_compare( GFCommon::$version, '1.8.5.8', '>=' ) )
return;
add_filter( 'gform_tooltips', array( $this, 'add_delete_tooltip') );
add_filter( 'gform_form_settings', array( $this, 'add_delete_setting' ), 10, 2 );
add_action( 'gform_pre_form_settings_save', array( $this, 'save_delete_setting' ), 10 );
add_action( 'gform_after_submission', array( $this, 'maybe_delete_form_entry' ), 15, 2 );
@joshfeck
joshfeck / archive-espresso_events.php
Last active January 15, 2016 14:02
Custom archive template for the Espresso Events post type. This can be used in a Genesis child theme. Requires Event Espresso 4.
<?php
remove_action ( 'genesis_loop', 'genesis_do_loop' ); // Remove the standard loop
add_action( 'genesis_loop', 'custom_espresso_events_archive_loop' ); // Add custom loop
// Optional: Remove post info
remove_action( 'genesis_before_post_content', 'genesis_post_info' );
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
function custom_espresso_events_archive_loop() {
anonymous
anonymous / gist:d6a5fd2bc73cf345f175
Created December 14, 2014 06:20
Genesis Functions.php for FacetWP
add_filter( 'genesis_attr_content', 'custom_attributes_content' );
/**
* Add the class needed for FacetWP to main element.
*
* Context: Posts page, all Archives and Search results page.
*
* @author Sridhar Katakam
* @link http://sridharkatakam.com/facetwp-genesis/
*/
function custom_attributes_content( $attributes ) {
@rymawby
rymawby / stripe-credit-card-numbers.md
Last active January 1, 2025 23:19
Stripe test credit card numbers for use in development

Test credit card numbers to use when developing with Stripe

4242424242424242 Visa

4012888888881881 Visa

4000056655665556 Visa (debit)

@digitalchild
digitalchild / functions.php
Last active September 24, 2015 23:15
Auto Complete Paid Orders if all products are virtual
<?php
// Place this in theme or your own agency plugin
add_filter( 'woocommerce_payment_complete_order_status', 'complete_paid_orders', 10, 2 );
/**
* Auto Complete Paid orders in WooCommerce
* only if all products are virtual in the order
*
* @author Jamie Madden <[email protected]>