This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@function em($target, $context: $base-font-size) { | |
@if $target == 0 { @return 0 } | |
@return $target / $context + 0em; | |
} | |
$base-font-size: 15px; | |
h1 { | |
font-size: em(21px, 15px); // Outputs 1.4em | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*-----------------------------------------------------------------------------------*/ | |
/* Conditional Logic to Detect Various Event Related Views/Pages | |
/*-----------------------------------------------------------------------------------*/ | |
if( tribe_is_month() && !is_tax() ) { // Month View Page | |
echo 'were on the month view page'; | |
} elseif( tribe_is_month() && is_tax() ) { // Month View Category Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(is_page() && !is_page_template()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Use the built-in post counter | |
* | |
* Sometimes you'll want to keep track of which post you're on in a loop. | |
* Some people create their own $loop_counter (ex: Genesis, https://gist.github.com/4675237 ). | |
* There's a better way! A loop counter is built into $wp_query. Ex: | |
* | |
* global $wp_query; | |
* echo $wp_query->current_post |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gravity Forms Custom Activation Template | |
* http://gravitywiz.com/customizing-gravity-forms-user-registration-activation-page | |
*/ | |
add_action('wp', 'custom_maybe_activate_user', 9); | |
function custom_maybe_activate_user() { | |
$template_path = STYLESHEETPATH . '/gfur-activate-template/activate.php'; | |
$is_activate_page = isset( $_GET['page'] ) && $_GET['page'] == 'gf_activation'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'), | |
debug = require('gulp-debug'), | |
size = require('gulp-filesize'), | |
clean = require('gulp-clean'), | |
coffee = require('gulp-coffee'), | |
coffeelint = require('gulp-coffeelint'), | |
gutil = require('gulp-util'), | |
sass = require('gulp-sass'), | |
imagemin = require('gulp-imagemin'), | |
changed = require('gulp-changed'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// UPDATE: Stefan from Stack Overflow has explained a better way to handle cart item data. | |
// See http://stackoverflow.com/a/32327810/470480 | |
// ---------------------- | |
/* | |
Instructions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// To add custom data above add to cart button in woocommerce | |
// step 1 | |
add_action('wp_ajax_wdm_add_user_custom_data_options', 'wdm_add_user_custom_data_options_callback'); | |
add_action('wp_ajax_nopriv_wdm_add_user_custom_data_options', 'wdm_add_user_custom_data_options_callback'); | |
function wdm_add_user_custom_data_options_callback() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove Access to the course linked to the subscription key | |
function remove_course_access( $user_id, $subscription_key ) { | |
// Get the course ID related to the subscription | |
$subscription = WC_Subscriptions_Manager::get_subscription( $subscription_key ); | |
$courses_id = get_post_meta($subscription['product_id'], '_related_course', true); | |
// Update access to the courses | |
if ($courses_id && is_array($courses_id)) { | |
foreach ($courses_id as $course_id) { |
OlderNewer