Skip to content

Instantly share code, notes, and snippets.

View zackn9ne's full-sized avatar

zackn9ne zackn9ne

  • earth, New York
View GitHub Profile
@zackn9ne
zackn9ne / gist:3306683
Created August 9, 2012 18:12
WordPress the_content_rss
<?php the_content_rss('', TRUE, '', 40); ?><a href="<?php the_permalink() ?>" title="<?php printf(__('Permalink to %s', 'sandbox'), wp_specialchars(get_the_title(), 1)) ?>" rel="bookmark">Read More</a>
@zackn9ne
zackn9ne / gist:3344158
Created August 13, 2012 21:13
WordPress if is Default Template
(is_page() && !is_page_template())
@zackn9ne
zackn9ne / gist:3670955
Created September 8, 2012 00:39
WordPress Upload Directory URL
<?php bloginfo(url); echo '/wp-content/uploads/'; ?>
@zackn9ne
zackn9ne / gist:3692805
Created September 10, 2012 18:36
addthis.com Social Sharing button with @Company
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet" tw:via="company"></a>
<a class="addthis_button_pinterest_pinit"></a>
<a class="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4f99e7191b55a96e"></script>
<!-- AddThis Button END -->
@zackn9ne
zackn9ne / gist:3696024
Created September 11, 2012 04:47
Wordpress Home Link
<?php bloginfo('url'); ?>
@zackn9ne
zackn9ne / gist:3704409
Created September 12, 2012 05:08
jQuery Safemode Open External Links In New Window for WordPress
<!-- asdfsript works in footer-->
<script>
jQuery(document).ready(function($) {
// $() will work as an alias for jQuery() inside of this function
});
$('a').each(function() {
var a = new RegExp('/' + window.location.host + '/');
if(!a.test(this.href)) {
$(this).click(function(event) {
event.preventDefault();
@zackn9ne
zackn9ne / gist:3759325
Created September 21, 2012 01:40
WordPress Redirect Template
<?php
/*
Template Name: Redirect
*/
?>
<?php if (have_posts()) : the_post(); ?>
<?php $URL = get_the_excerpt(); if (!preg_match('/^http:\/\//', $URL)) $URL = 'http://' . $URL; ?>
@zackn9ne
zackn9ne / gist:3802567
Created September 28, 2012 23:22
AddThis Code
<script type="text/javascript">
var addthis_config = {
data_track_clickback: false
}
</script>
@zackn9ne
zackn9ne / functions.php
Created October 8, 2012 22:06
Change WordPress Login URL and IMG
// verander WP-Logo login.php
function my_custom_login_logo() {
echo '<style type="text/css">
h1 a { background-image:url('.get_bloginfo('template_directory').'/images/pad-naar-logo.png) !important; }
</style>';
}
add_action('login_head', 'my_custom_login_logo');
// verander de url op de login pagina
function put_my_url(){
@zackn9ne
zackn9ne / .htaccess
Created October 11, 2012 16:40
.htaccess for Yoast XML Sitemaps to Work
# WordPress SEO - XML Sitemap Rewrite Fix
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^sitemap_index\.xml$ /index.php?sitemap=1 [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
</IfModule>
# END WordPress SEO - XML Sitemap Rewrite Fix