Skip to content

Instantly share code, notes, and snippets.

Avatar

Bruce Munson WebEndevSnippets

View GitHub Profile
@WebEndevSnippets
WebEndevSnippets / functions.php
Created Oct 3, 2018
UUAB Custom Image Sizes
View functions.php
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 Aug 29, 2015
Autocomplete all Woocommerce Paid Orders
View functions.php
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 Apr 9, 2015
Add Login / Logout Links To The Custom Menu Area
View functions.php
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>';
View gist:388cebbc52208915ade4

/** 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

View gist:87798041fc0c50adbda5
/** 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
View gist:825bab879026e88f97e5
/**
* 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 Jun 7, 2014
Gravity Forms: Remove Submit Button on Gravity Form
View functions.php
// Remove Submit Button on Gravity Form
add_filter( 'gform_submit_button_12', '__return_false' );
@WebEndevSnippets
WebEndevSnippets / 0_reuse_code.js
Created May 29, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// 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 Mar 24, 2014
Genesis: Display featured image on pages after title
View functions.php
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 Mar 21, 2014
Genesis: Filter H1 post title output
View functions.php
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() ) );
You can’t perform that action at this time.