Skip to content

Instantly share code, notes, and snippets.

View smjuber's full-sized avatar
🙂
Howdy, Stranger.

Mehadi Hasan Juber smjuber

🙂
Howdy, Stranger.
View GitHub Profile
<?php
// Numeric Page Navigation
function bones_page_navi() {
global $wp_query;
$bignum = 999999999;
if ( $wp_query->max_num_pages <= 1 )
return;
echo '<nav class="pagination">';
@smjuber
smjuber / gist:96e5d37ae2e218e07221d540dc9f4fcc
Created September 30, 2018 20:02 — forked from gam3ov3r/gist:2724041
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@smjuber
smjuber / footer.php.html
Created September 30, 2018 19:19 — forked from ajtroxell/footer.php.html
Using Magnific Popup with Wordpress Now, from: http://ajtroxell.com/using-magnific-popup-with-wordpress-now/