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 | |
/** | |
* Assuming you want 8 latest posts and excluding sticky posts | |
*/ | |
$posts_args = array( | |
'ignore_sticky_posts' => true, | |
'posts_per_page' => 8 | |
); |
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 | |
function eyn_wb17_excerpt_from_content( $content, $wordlimit, $url, $readmore = 'Read More' ) { | |
// Action hook before any output! | |
do_action( 'eyn_wb17_before_excerpt' ); | |
// Make the Read More text filterable | |
$readmore = apply_filters( 'eyn_wb17_excerpt_rmtext', $readmore ); |
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 ($) { | |
$(document).ready(function () { | |
$('#next').click(function () { | |
$.ajax({ | |
type: 'POST', | |
url: PT_Ajax.ajaxurl, | |
data: { | |
// wp ajax action | |
action: 'ajax-inputtitleSubmit', |
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
/* | |
* Add our Custom Fields to simple products | |
*/ | |
function mytheme_woo_add_custom_fields() { | |
global $woocommerce, $post; | |
echo '<div class="options_group">'; | |
// Text Field |
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 | |
/* | |
Plugin Name: Homepage Settings for BigBang | |
Plugin URI: http://www.inboundnow.com/ | |
Description: Adds additional functionality to the big bang theme. | |
Author: David Wells | |
Author URI: http://www.inboundnow.com | |
*/ | |
// Specify Hooks/Filters |
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 | |
$args = array( | |
'label' => '', // Text in Label | |
'class' => '', | |
'style' => '', | |
'wrapper_class' => '', | |
'value' => '', // if empty, retrieved from post meta where id is the meta_key | |
'id' => '', // required | |
'name' => '', //name will set from id if empty |
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 | |
/** | |
* APIs and jQuery plugins used: | |
* | |
* Geo IP Lookup - to get longitude, latitude and time zone data by ip | |
* https://json.geoiplookup.io/ | |
* | |
* Suncalc - Calculate Sun/Moon positions and phases | |
* https://github.com/mourner/suncalc | |
* |
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
/** | |
* Get Object Size | |
* ---------------- | |
* Function to validate the existence of each key in the object to get the number of valid keys. | |
* | |
* @see https://css-tricks.com/snippets/javascript/get-object-size/ | |
*/ | |
function objectSize(the_object) { | |
var object_size = 0; |
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
MEMBERSHIP OBJECT | |
array(1) { | |
[0]=> object(WC_Memberships_User_Membership)#25232 (18) { | |
["id"]=> int(1828) | |
["plan_id"]=> int(1821) | |
["plan"]=> object(WC_Memberships_Membership_Plan)#25234 (14) { |
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 qsa_update_user_meta($customer_id) { | |
$cid = $customer_id; | |
$ms = wc_memberships_get_user_active_memberships( $cid ); | |
if ( ! empty( $ms ) ) : | |
// We handle the first active membership as The Membership!! | |
$m = $ms[0]; | |
$mid = $m->plan_id; |
OlderNewer