Skip to content

Instantly share code, notes, and snippets.

@jeremyfelt
jeremyfelt / wp-seo.php
Created October 5, 2012 06:34
Gist description...
add_action( 'init', 'jf_register_my_new_sitemap', 99 );
/**
* On init, run the function that will register our new sitemap as well
* as the function that will be used to generate the XML. This creates an
* action that we can hook into built around the new
* sitemap name - 'wp_seo_do_sitemap_my_new_sitemap'
*/
function jf_register_my_new_sitemap() {
global $wpseo_sitemaps;
$wpseo_sitemaps->register_sitemap( 'my_new_sitemap', 'jf_generate_my_new_sitemap' );
@whitingx
whitingx / meta-tags.md
Created October 5, 2012 16:41 — forked from kevinSuttle/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@germanny
germanny / inc-state-abbreviations.php
Created October 10, 2012 22:41
Responsive States Map. Includes states listing with abbreviations and AI file of the map. Uses both http://archive.plugins.jquery.com/project/maphilight and https://github.com/stowball/jQuery-rwdImageMaps. Requires the latest version of jQuery or you'll b
<?php
switch ($map_state)
{
case 'Alabama':
$abbr = 'AL';
break;
case 'Alaska':
$abbr = 'AK';
break;
@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
@jazzsequence
jazzsequence / breadcrumbs.php
Created October 11, 2012 19:41
WordPress SEO Breadcrumbs
/**
* SEO Breadcrumbs
* @author Chris Reynolds
* @link http://www.quickonlinetips.com/archives/2012/02/wordpress-seo-breadcrumbs/
* Search engine optimized breadcrumbs. Original source was taken from the link above, with changes made so that it supports pages as well as posts and integrates into Twitter Bootstrap breadcrumb styles
*/
function seo_breadcrumbs() {
// this sets up some breadcrumbs for posts & pages that support Twitter Bootstrap styles
$separator = ' <span class="divider">&rsaquo;</span>';
echo '<ul xmlns:v="http://rdf.data-vocabulary.org/#" class="breadcrumb">';
@andregoncalves
andregoncalves / form-submit-tracking-1.js
Created October 27, 2012 10:35
Analytics form submit tracking 2
$("form").on('submit', function(e) {
var form = this;
if (_gaq) {
e.preventDefault();
_gaq.push(['_trackEvent', 'my category', 'my action']);
setTimeout(function() { form.submit(); }, 100);
return false;
}
<?php
class Debug {
private static $log = array();
public static function trigger($type, $data, &$caller) {
if(!isset(self::$log[$type])) self::$log[$type] = array();
if(!isset(self::$log[$type.'_func'])) self::$log[$type.'_func'] = array();
self::$log[$type][] = $data;
self::$log[$type.'_func'][] = array($caller[0]['file'],$caller[0]['line'],(!empty($caller[1]['class']) ? '<br/>'.$caller[1]['class'].'::'.$caller[1]['function'] : ''));
}
@retlehs
retlehs / gist:4120053
Created November 20, 2012 18:45
Remove unnecessary markup from WooCommerce
<?php
/**
* Remove unnecessary markup from WooCommerce:
*
* 1. Remove <meta name="generator" content="WooCommerce (version)" />
* 2. Remove the addition of <body class="theme-themename">
*/
function woocommerce_head_cleanup() {
global $woocommerce;
@gcherubin
gcherubin / gist:4154806
Created November 27, 2012 15:27
Wordpress Snippets
<?php
/**
* WordPress Snippets
* Compiled by goanimal
*/
?>
<?php ////// Metatag and Open Graph ?>
<?php