Skip to content

Instantly share code, notes, and snippets.

View fedesilvaponte's full-sized avatar

Federico Silva Ponte fedesilvaponte

View GitHub Profile
<?php
/*
Plugin Name: Plugin Name
Plugin URI: http://example.com/the-plugin
Description: A brief description of the Plugin.
Version: 1.0
Author: Your name
Author URI: http://example.com
License: GPL2?
*/
@fedesilvaponte
fedesilvaponte / wp_tweet_btn.php
Created August 2, 2012 12:05
WP Tweet Button
<a href="http://twitter.com/share" class="twitter-share-button" data-url="<?php the_permalink() ?>" data-count="vertical" data-via="<?php bloginfo('name') ?>">Tweet</a>
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
@fedesilvaponte
fedesilvaponte / wp_google_btn.php
Created August 2, 2012 12:04
WP Google + Button
<!-- Place this tag in your head or just before your close body tag -->
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<!-- Place this tag where you want the +1 button to render -->
<g:plusone></g:plusone>
@fedesilvaponte
fedesilvaponte / wp_pagination.php
Created August 2, 2012 11:40
WP Pagination without plugin
<?php
function pagination($prev = '«', $next = '»') {
global $wp_query, $wp_rewrite;
$wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1;
$pagination = array(
'base' => @add_query_arg('paged','%#%'),
'format' => '',
'total' => $wp_query->max_num_pages,
'current' => $current,
'prev_text' => __($prev),