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 | |
// 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 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']); |
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
Hello World! |
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 | |
// Do not add above line. | |
add_filter('bbp_no_breadcrumb', function($arg) { return true; } ); |
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 | |
// add ie conditional html5 shim to header | |
function _s_add_ie_html5_shim () { | |
echo '<!--[if lt IE 9]>'; | |
echo '<script src="' . get_template_directory_uri() . '/js/html5.js"></script>'; | |
echo '<![endif]-->'; | |
} | |
add_action('wp_head', '_s_add_ie_html5_shim'); |
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 | |
// Do not copy opening php tag | |
function bb_auth_reply_view( $reply_id ) { | |
$reply_id = bbp_get_reply_id( $reply_id ); | |
// Check if password is required | |
if ( post_password_required( $reply_id ) ) | |
return get_the_password_form(); |
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 Add Google Tag Manager script on Thesis Theme Framework | |
* | |
* @author Anand Kumar | |
* @link http://www.blogsynthesis.com/add-google-tag-manager-to-wordpress/#thesis-theme-framework | |
* | |
*/ | |
function limit_front_page() { | |
global $query_string; |
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
/*** Facebook Comment for Single Posts ***/ | |
add_action('genesis_before_comments', 'facebook_comments'); | |
/*** More info at www.blogsynthesis.com/?p=892 ***/ | |
function facebook_comments() { | |
if (is_single()) { ?> | |
<div class="fb-comments" data-href="<?php the_permalink(); ?>" data-num-posts="5" data-width="600"></div> | |
<?php } | |
} |
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
<script type="text/javascript"> | |
google_ad_client = "ca-publisher-id", | |
if (window. innerWidth> = 800) { | |
google_ad_slot = " ad-unit-1 "; | |
google_ad_width = 728; | |
google_ad_height = 90; | |
} Else if (window.innerWidth <400) { | |
google_ad_slot = " ad-unit-2 "; | |
google_ad_width = 300; | |
google_ad_height = 250; |
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 | |
// Do not copy starting php tag | |
function remove_x_pingback($headers) { | |
unset($headers['X-Pingback']); | |
return $headers; | |
} | |
add_filter('wp_headers', 'remove_x_pingback'); |
OlderNewer