Skip to content

Instantly share code, notes, and snippets.

View WebEndevSnippets's full-sized avatar

Bruce Munson WebEndevSnippets

View GitHub Profile
@WebEndevSnippets
WebEndevSnippets / functions.php
Created October 3, 2018 17:33
UUAB Custom Image Sizes
add_action( 'after_setup_theme', 'wpss_theme_setup' );
/**
* Create custom image sizes
*/
function wpss_theme_setup() {
add_image_size( 'pdfv_thumbnail', 115, 150, true );
add_image_size( 'activity-thumb', 100, 120, true );
add_image_size( 'featured', 590, 250, TRUE );
add_image_size( 'home-slider-crop', 615, 245, TRUE ); //540x?
add_image_size( 'home-slider', 615, 245, FALSE ); //540x?
@WebEndevSnippets
WebEndevSnippets / functions.php
Last active August 29, 2015 14:19
Autocomplete all Woocommerce Paid Orders
add_filter( 'woocommerce_payment_complete_order_status', 'bryce_wc_autocomplete_paid_orders' );
/**
* Add login/logout and registration links to header menu
*
* @author Bryce Adams
* @link http://bryceadams.com/autocomplete-orders-woocommerce/
*
*/
function bryce_wc_autocomplete_paid_orders( $order_status, $order_id ) {
@WebEndevSnippets
WebEndevSnippets / functions.php
Created April 9, 2015 18:50
Add Login / Logout Links To The Custom Menu Area
add_filter( 'wp_nav_menu_items', 'we_add_loginout_link', 10, 2 );
/**
* Add login/logout and registration links to header menu
*
* @author Bruce Munson, WebEndev
*
*/
function we_add_loginout_link( $items, $args ) {
if (is_user_logged_in() && $args->theme_location == 'header') {
$items .= '<li class="menu-item"><a href="'. wp_logout_url() .'">Log Out</a></li>';

/** Procedure for Site Transfer from WPE to Other Host */

  1. Download latest ZIP from WPE (Backup Points) + last 29 zips

  2. Download uploads folder (and all other custom/non-WordPress folders)

  3. Upload WPE ZIP to new server

  4. Extract/unzip WPE ZIP file on new server

/** Procedure for Site Transfer from WPE to Other Host */
(1) Download ZIP from WPE (Backup Points)
(2) Upload WPE ZIP to new server
(3) Create new wp-config.php file with new DB_NAME, DB_USER, DB_PASSWORD, Keys and Salts, and $table_prefix.
(3a) Add
define( 'WP_POST_REVISIONS', FALSE )
(3b) Add
@WebEndevSnippets
WebEndevSnippets / gist:825bab879026e88f97e5
Created October 2, 2014 15:38
ssz taxo detail output
/**
* Displays the Single Activity Post Meta Details
*
* Sets a site transient to make this simple and display quickly.
*
* @uses genesis_grid_loop() Generates the Grid Loop
*/
function ssz_single_activities_post_meta() {
global $post;
@WebEndevSnippets
WebEndevSnippets / functions.php
Created June 7, 2014 15:24
Gravity Forms: Remove Submit Button on Gravity Form
// Remove Submit Button on Gravity Form
add_filter( 'gform_submit_button_12', '__return_false' );
@WebEndevSnippets
WebEndevSnippets / 0_reuse_code.js
Created May 29, 2014 13:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@WebEndevSnippets
WebEndevSnippets / functions.php
Created March 24, 2014 13:46
Genesis: Display featured image on pages after title
add_action( 'genesis_entry_header', 'we_page_featured_image', 15 );
/**
* Display featured image on pages, after title
*/
function we_page_featured_image() {
if ( ! is_singular( 'page' ) )
return;
@WebEndevSnippets
WebEndevSnippets / functions.php
Created March 21, 2014 16:13
Genesis: Filter H1 post title output
add_filter( 'genesis_post_title_output', 'we_post_title_output', 15 );
/**
* Filter H1 post title to add Font Awesome Styling
*
*/
function we_post_title_output( $title ) {
if ( is_page( 22 ) )
$title = sprintf( '<h1 class="entry-title"><i class="fa fa-cog"></i> %s</h1>', apply_filters( 'genesis_post_title_text', get_the_title() ) );