This file contains hidden or 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
/* Smooth Back to Top, Get This functionality from: http://wordpress.org/extend/plugins/cudazi-scroll-to-top/ */ | |
jQuery.noConflict(); | |
jQuery(function($) { | |
// When to show the scroll link | |
// higher number = scroll link appears further down the page | |
var upperLimit = 100; | |
// Our scroll link element |
This file contains hidden or 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 | |
// EDD Prevent Double Purchase | |
function pw_edd_prevent_double_purchase( $valid_data, $post_data ) { | |
$cart_items = edd_get_cart_contents(); | |
foreach( $cart_items as $item ) { | |
if( edd_has_user_purchased( get_current_user_id(), $item['id'] ) ) { | |
edd_set_error( 'double_purchase', __( 'You may not purchase this item again until your subscription expires', 'edd' ) ); | |
} | |
} |
This file contains hidden or 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 | |
/** | |
* Usage: | |
* Paste a gist link into a blog post or page and it will be embedded eg: | |
* https://gist.github.com/2926827 | |
* | |
* If a gist has multiple files you can select one using a url in the following format: | |
* https://gist.github.com/2926827?file=embed-gist.php | |
*/ |
This file contains hidden or 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
// Display Topic Leads | |
add_filter('bbp_show_lead_topic', 'custom_bbp_show_lead_topic' ); | |
function custom_bbp_show_lead_topic( $show_lead ) { | |
if ( !is_user_logged_in() ){ | |
$show_lead[] = 'true'; | |
return $show_lead; | |
}} | |
// Show Topic Leads to Public or Anonymous visitors | |
add_filter('bbp_has_replies', 'synth_logged_in_topics'); |
This file contains hidden or 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 WordPress Admin bar | |
add_action('after_setup_theme', 'remove_admin_bar'); | |
function remove_admin_bar() { | |
if (!current_user_can('administrator') && !is_admin()) { | |
show_admin_bar(false); | |
} | |
} | |
This file contains hidden or 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 | |
//* Do NOT include the opening php tag | |
//* Remove posted comments from Genesis | |
remove_action( 'genesis_comments', 'genesis_do_comments' ); |
This file contains hidden or 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
/** Move Genesis Comments */ | |
add_action( 'genesis_before_comments' , 'eo_move_comments' ); | |
function eo_move_comments () | |
{ | |
if ( is_single() && have_comments() ) | |
{ | |
remove_action( 'genesis_comment_form', 'genesis_do_comment_form' ); | |
add_action( 'genesis_comments', 'genesis_do_comment_form', 5 ); | |
} | |
} |
This file contains hidden or 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
<script type="text/javascript"> | |
var comments = document.getElementsByClassName('comments')[0], | |
disqusLoaded=false; | |
function loadDisqus() { | |
var disqus_shortname = 'netrival'; | |
var dsq = document.createElement('script'); | |
dsq.type = 'text/javascript'; | |
dsq.async = true; | |
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; |
This file contains hidden or 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 my_custom_get_dynamic_roles( $bbp_roles ) | |
{ | |
/* Add a role called Community Contributor */ | |
$bbp_roles['bbp_basic_member'] = array( | |
'name' => 'Basic Member', | |
'capabilities' => my_custom_get_caps_for_role( 'bbp_basic_member' ) | |
); | |
This file contains hidden or 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 pj_hla_logged_in_topics($have_posts){ | |
if (!is_user_logged_in()){ | |
$have_posts = null; | |
echo 'Login to see replies'; | |
} | |
return $have_posts; | |
} | |
add_filter('bbp_has_topics', 'pj_hla_logged_in_topics'); | |
add_filter('bbp_has_forums', 'pj_hla_logged_in_topics'); |