Skip to content

Instantly share code, notes, and snippets.

View unwiredtech's full-sized avatar

Patrick Sarmiento unwiredtech

View GitHub Profile
<?php
//Add in new Widget areas
function genesischild_extra_widgets() {
genesis_register_sidebar( array(
'id' => 'preheaderleft',
'name' => __( 'preHeaderLeft', 'genesischild' ),
'description' => __( 'This is the preheader Left area', 'genesischild' ),
'before_widget' => '<div class="first one-half preheaderleft">',
'after_widget' => '</div>',
@unwiredtech
unwiredtech / functions.php
Created February 18, 2016 09:40 — forked from srikat/functions.php
Adding Simple Social Icons to Navigation bar in Genesis. http://sridharkatakam.com/adding-simple-social-icons-navigation-bar-genesis/
genesis_register_sidebar( array(
'id' => 'nav-social-menu',
'name' => __( 'Nav Social Menu', 'your-theme-slug' ),
'description' => __( 'This is the nav social menu section.', 'your-theme-slug' ),
) );
add_filter( 'genesis_nav_items', 'sws_social_icons', 10, 2 );
add_filter( 'wp_nav_menu_items', 'sws_social_icons', 10, 2 );
function sws_social_icons($menu, $args) {
@unwiredtech
unwiredtech / my_pmpro_after_change_membership_level.php
Created February 29, 2016 16:50 — forked from strangerstudios/my_pmpro_after_change_membership_level.php
Remove user role when users cancel in Paid Memberships Pro
/*
Remove user role when users cancel.
*/
function my_pmpro_after_change_membership_level($level_id, $user_id)
{
if(empty($level_id))
{
//If they are a subscriber, remove their role.
$wp_user_object = new WP_User($user_id);
if(in_array("subscriber", $wp_user_object->roles))
@unwiredtech
unwiredtech / pmpro-change-role-custom-roles.php
Created February 29, 2016 16:56 — forked from strangerstudios/pmpro-change-role-custom-roles.php
Change roles for new PMPro members to custom roles at checkout based on level. Add this code to your active theme's functions.php or a custom plugin.
<?php
/*
This code assumes you already have custom roles created
for bronzemember, silvermember, and goldmember.
Members signing up for membership level #1 get "Bronze Member" role.
Members signing up for membership level #2 get "Silver Member" role.
Members signing up for membership level #3 get "Gold Member" role.
Members cancelling are given the subscriber role.
Admin users are ignored.
*/
@unwiredtech
unwiredtech / pmpro_customizations.php
Created February 29, 2016 16:58 — forked from strangerstudios/pmpro_customizations.php
Add a one-time-use 14 day trial to a monthly recurring membership level with Paid Memberships Pro. Place this file in wp-content/plugins/pmpro-customizations/pmpro-customizations.php on your site, then active the plugin through the WP dashboard.
<?php
/*
Plugin Name: PMPro Customizations
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Customizations for Paid Memberships Pro (14 day trial on level 1)
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/