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
<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
/** 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
<?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
// 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
// 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
<?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
<?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
/* 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 | |
// Add meta box to all post_types | |
// Customised by Anand Kumar @blogsynthesis.com | |
function ta_mytheme_post_add_box() { | |
global $wpar_meta_box; | |
$post_types = get_post_types(); | |
foreach ( $post_types as $post_type ) { | |
add_meta_box($wpar_meta_box['id'], $wpar_meta_box['title'], 'ta_mytheme_post_show_box', $post_type, $wpar_meta_box['context'], $wpar_meta_box['priority']); |