Skip to content

Instantly share code, notes, and snippets.

View bryanmonzon's full-sized avatar
🧇

Bryan Monzon bryanmonzon

🧇
View GitHub Profile

Keybase proof

I hereby claim:

  • I am bryanmonzon on github.
  • I am mnzn (https://keybase.io/mnzn) on keybase.
  • I have a public key ASB0fPSdjEYIn1zK0kP_lWvhn6YZZvZp3phMezbnjshAmwo

To claim this, I am signing this object:

<?php
/**
* @package Meteor Child Theme
*/
/**
* Load the parent and child theme styles
*/
function meteor_parent_theme_style() {
@bryanmonzon
bryanmonzon / cached-donations-solution.php
Last active May 6, 2016 00:37
If you're using WordPress, you can easily cache your donations using these two functions. Make sure to enter your API key and SUBDOMAIN
<?php
/**
* Get and store API call in a transient for better
* performance.
* @return object from either a transient or the API directly
*/
function notforsale_get_donations()
{
$donations = get_transient( 'dntly_donations' ); //Get's the value stored in the transient
@bryanmonzon
bryanmonzon / single-dntly_campaigns.php
Created February 21, 2015 00:34
Sample code for getting and returning campaign post meta.
<?php
/**
* Assuming we're on the Campaign Single template
* this is what it would look like to access and show
* campaign data.
*
* Note: This is just a sample template.
*/
get_header();
<div class="member-wrapper">
<?php
$args = array(
'role' => 'practitioner',
'number' => 10
);
$user_query = new WP_User_Query( $args );
if( !empty( $user_query ) ) :
<?php
function my_remove_wp_seo_meta_box() {
if( !current_user_can('manage_options' ) ) {
remove_meta_box( 'wpseo_meta', 'artist', 'normal' );
}
}
add_action( 'add_meta_boxes', 'my_remove_wp_seo_meta_box' );
///////////////////////////////
// Set Variables
///////////////////////////////
var gridContainer = jQuery('.thumbs');
var colW;
var gridGutter = 0;
var thumbWidth = 350;
var widgetsHidden = false;
var themeColumns = 3;
<?php
if( is_page( 'page-slug-or-ID-here') ){
wp_nav_menu( 'menu-id-here')
}elseif( is_page('another-slug')) {
wp_nav_menu( 'another-menu-id-here')
}
//Another solution is to register your menus with page slugs and then output a menu
<?php
//First you register the script
//The parameters are (title, path, what the script depends on, version-leave this blank, in footer)
wp_register_script('GIVE-IT-A-UNIQUE-TITLE-HERE', get_bloginfo('template_url').'/js/skrollr.js', array( 'jquery' ), '', true);
//Then you enqueue it (so it renders on the page)
wp_enqueue_script('skrollr');
@bryanmonzon
bryanmonzon / gist:fb5953634700e9513925
Created September 9, 2014 22:14
Grab a list of Gravity Form IDs for use in post meta
<?php
if( class_exists( 'RGFormsModel' ) ){
$select = '<select name="s_camps_gforms_id">';
$select .= '<option>--No Form</option>';
$forms = RGFormsModel::get_forms( null, 'title' );
foreach( $forms as $form ) {
$select .= '<option id="' . $form->id . '" value="'. $form->id.'" '. selected( $s_camps_gforms_id, $form->id, false).'>' . $form->title . '</option>';
}