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
*/
@unwiredtech
unwiredtech / woocommerce-get-purchase-link.php
Created October 3, 2017 08:45
woocommerce-get-purchase-link
@unwiredtech
unwiredtech / taxonomy_terms.php
Created October 6, 2017 18:26
WordpressTaxonomy Terms Template
<?php // get_template_part('archive-kb'); ?>
<?php
/**
* The template for displaying Archive pages
*
* Used to display archive-type pages if nothing more specific matches a query.
* For example, puts together date-based pages if no date.php file exists.
*
<?php
if ( ( is_user_logged_in() && $current_user->ID == $post->post_author ) ) { // Execute code if user is logged in or user is the author
acf_form_head();
wp_deregister_style( 'wp-admin' );
}
get_header();
?>
@unwiredtech
unwiredtech / op2-smoothscroll.js
Last active August 5, 2018 16:08
OptimizePress 2.0 Smooth Scroll
/* Optimize Press 2.0 Smooth Scroll */
/* Add this to your page-setting */
/* Anchor tag jump will be smooth */
<script>
opjq(function($) {
$('a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
@unwiredtech
unwiredtech / cf-7-2-column.css
Created September 21, 2018 07:48
Contact form 7 - 2 column
.cf-wrapper{
position: relative;
}
#left-input {
width: 47%;
float: left;
margin-right:6%;
}