Skip to content

Instantly share code, notes, and snippets.

Brad Williams williamsba

Block or report user

Report or block williamsba

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:9242583
javascript:(function(){var total=0,count=0;jQuery('p.downloads').each(function(i,e){count++;total+=parseInt(jQuery(e).text().replace(/,/g,''));});total=total.toString().replace(/\B(?=(\d{3})+(?!\d))/g,',');alert(count+' plugins and '+total+' downloads');})();
View gist:9105796
javascript:var s = document.createElement('script');s.type='text/javascript';document.body.appendChild(s);s.src='http://erkie.github.com/asteroids.min.js';void(0);
@williamsba
williamsba / gist:8851321
Created Feb 6, 2014
Return only the latest product version on the front-end in Easy Digital Downloads
View gist:8851321
add_filter( 'edd_download_files', 'appp_show_latest_product_version' );
function appp_show_latest_product_version( $files ) {
//only show the latest version of a product everywhere except the admin dashboard
if ( is_array( $files ) && ! is_admin() ) {
//count the file array size
$arr_count = count( $files );
View gist:8199571
javascript:(function(){var%20total=0,count=0;jQuery('p.downloads').each(function(i,e){count++;total+=parseInt(jQuery(e).text().replace(/,/g,''));});total=total.toString().replace(/\B(?=(\d{3})+(?!\d))/g,',');alert(count+'%20plugins%20and%20'+total+'%20downloads');})();
@williamsba
williamsba / gist:7824876
Created Dec 6, 2013
How to get the page view count from Jetpack in WordPress
View gist:7824876
/**
* Get post pageview count
*/
function wds_post_pageview_count( $post_id ) {
// Check for transient
if ( ! ( $count = get_transient( 'wds_post_pageview_count' . $post_id ) ) ) {
// Verify we're running Jetpack
if ( function_exists( 'stats_get_csv' ) ) {
@williamsba
williamsba / gist:6240607
Created Aug 15, 2013
WordPress plugin to show full RSS post content when a specific query string exists
View gist:6240607
<?php
/*
Plugin Name: RSS Feed Customizer
Plugin URI: http://webdevstudios.com
Description: Show full RSS content entries using a query string ( ex: http://example.com/feed/?display=full )
Version: 1.0
Author: THE Brad
Author URI: http://webdevstudios.com
*/
View gist:6193318
<span>
<?php $author_email = explode( '@', $curauth->user_email ); ?>
<script language=javascript>
<!--
var contact = "Email Author"
var email = "<?php echo $author_email[0]; ?>"
var emailHost = "<?php echo $author_email[1]; ?>"
document.write("<a href=" + "mail" + "to:" + email + "@" + emailHost+ ">" + contact + "</a>" + ".")
//-->
</script>
View gist:4709867
CURRENT AD CODE
<!-- begin ad tag (tile=1) --><script language="JavaScript" type="text/javascript">ord=Math.random()*10000000000000000;url_script=window.location.href;document.write('<script language="JavaScript" src="http://ad.doubleclick.net/adj/trb.ktla/tech;tile=1;ptype=sfbrd;pos=1brd;sz=300x250;ord=' + ord + '?" type="text/javascript"><\/script>');</script><noscript><a href="http://ad.doubleclick.net/jump/trb.ktla/tech;ptype=sfbrd;pos=1brd;tile=1;sz=300x250;ord=123456789?" target="_blank"><img src="http://ad.doubleclick.net/ad/trb.ktla/tech;ptype=sfbrd;pos=1brd;tile=1;sz=300x250;ord=123456789?" width="300" height="250" border="0" alt=""></a></noscript><!-- End ad tag -->
NEW AD CODE
<script language="JavaScript" type="text/javascript">
document.write('<a href="%%CLICK_URL_UNESC%%http://clk.atdmt.com/CNT/go/430612898/direct;wi.300;hi.250/01/" target="_blank"><img src="http://view.atdmt.com/CNT/view/430612898/direct;wi.300;hi.250/01/%%CACHEBUSTER%%"/></a>');
</script>
<noscript>
<a href="%%CLICK_URL_UN
View gist:4673939
/upgrade
/plugins/akismet
/plugins/debug-bar
/plugins/hello.php
/themes/twentyeleven
/themes/twentytwelve
/themes/startbox
/uploads
.DS_Store
View gist:4627486
$params = array (
'meta_key' => 'review_image_value',
'orderby' => 'meta_value_num',
'order' => 'DESC'
);
$query = new WP_Query( $params );
while ( $query->have_posts() ) :
$query->the_post();
You can’t perform that action at this time.