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 | |
/** | |
* Disable all sales. | |
* | |
* A simple function to disable all the sales in the shop. | |
* Uncomment the line of code to disable the sale price on products. | |
*/ | |
function custom_wc_get_sale_price( $sale_price, $product ) { |
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
<div id="fbComments" style="width:100%px;"> | |
<h3>Questions & Comments</h3> | |
<div class="fb-like op-fbComments--like" data-href="https://learntobeabookkeeper.com/how-to-develop-an-abundance-mindset/" data-colorscheme="" data-layout="standard" data-action="like" data-show-faces="false"></div> | |
<fb:comments href="https://learntobeabookkeeper.com/how-to-develop-an-abundance-mindset/" num_posts="20" publish_feed="true" migrated="1" data-width="100%" data-order-by="reverse_time" class="op-fbComments--comments"></fb:comments> | |
</div> |
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
// Code To Display Sticky Posts For All Custom Post Types | |
function lab_latest_sticky_all() { | |
$args = array( | |
'post__in' => get_option( 'sticky_posts' ), | |
'showposts' => 4, | |
'post_type' => array ('download','post', 'page', 'latest', 'topic', 'forum', 'webinars', 'hangouts', 'lessons', 'kits'), | |
'ignore_sticky_posts' => 1 | |
); | |
$the_query = new WP_Query( $args ); | |
while ($the_query -> have_posts()) : $the_query -> the_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
function assign_pmpro_level_to_role($user_id, $role, $old_roles) | |
{ | |
global $current_user; | |
//checks if the user doesn't have a membership level yet | |
if(!$current_user->ID) { | |
//we found a role related to pmpro level | |
if($role == "customer") | |
{ | |
pmpro_changeMembershipLevel(20, $user_id); //gives default customers the level 20 free registration membership |
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
/*-- http://wordpress.stackexchange.com/questions/130075/stop-wordpress-automatically-adding-br-tags-to-post-content ---*/ | |
remove_filter( 'the_content', 'wpautop' ); | |
remove_filter( 'the_excerpt', 'wpautop' ); | |
function wpse_wpautop_nobr( $content ) { | |
return wpautop( $content, false ); | |
} | |
add_filter( 'the_content', 'wpse_wpautop_nobr' ); |
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: PMPro Customizations | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Custom Prorating Code and Other Code for PMPro | |
Version: .1 | |
Author: Stranger Studios | |
Author URI: http://www.strangerstudios.com | |
*/ |
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
/* | |
Set levels as "all access levels" so members of these levels will be able to view all Addon Packages. | |
Requires Paid Memberships Pro and the pmpro-addon-packages plugin. | |
*/ | |
function my_pmproap_all_access_levels($levels, $user_id, $post_id) | |
{ | |
//I'm just adding the level, but I could do some calculation based on the user and post id to programatically give access to content | |
$levels = array(16); | |
return $levels; | |
} |
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
/* | |
Only let level 1 members sign up if they use a discount code. | |
Place this code in your active theme's functions.php or a custom plugin. | |
*/ | |
function my_pmpro_registration_checks_require_code_to_register($pmpro_continue_registration) | |
{ | |
//only bother if things are okay so far | |
if(!$pmpro_continue_registration) | |
return $pmpro_continue_registration; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Wistia Upload Widget via API </title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<style> | |
#wistia { width: 500px; height: 75px; } | |
</style> | |
</head> | |
<body> |
NewerOlder