Skip to content

Instantly share code, notes, and snippets.

@jakebellacera
jakebellacera / floodlight-click-handler.js
Last active June 26, 2019 21:31
Floodlight click handler
document.getElementById("button").addEventListener("click", function(e) {
e.preventDefault();
var url = this.getAttribute("href", 2);
createFloodlightTag("source", "type", "cat", function() {
window.location = url; // Redirect the user after the tag successfully fires
});
});
function createFloodlightTag(source, type, cat, callback) {
@blogjunkie
blogjunkie / functions.php
Last active March 16, 2019 01:06
Custom page titles for co-authors with WordPress SEO
<?php
/**
* Custom page titles for Guest Authors with WordPress SEO
* Returns "[author name]&#39;s articles on [site name]"
*
*/
add_filter('wpseo_title', 'my_co_author_wseo_title');
function my_co_author_wseo_title( $title ) {
@tamarazuk
tamarazuk / woocommerce-csv-export-separate-item-meta.php
Last active August 31, 2018 04:42
Customer/Order CSV Export: Separate item meta into multiple columns in the Default – One Row per Item format
<?php // only copy this line if needed
/**
* The use of this snippet requires at least WooCommerce 3.2
*/
/**
* Alter the column headers for the orders CSV to split item_meta into separate columns
*
* Note that this change is only applied to the Default - One Row per Item format
@salcode
salcode / .gitignore
Last active February 10, 2024 10:56
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@rahuldass
rahuldass / HTML5 Starter Template.md
Last active August 29, 2015 13:56
HTML5 Starter Template #html5

###HTML5 Starter Template

Basic HTML5 starter template with HTML5 Shiv for older IE browsers.

HTML

<!doctype html>
<html lang="en">
@MikeNGarrett
MikeNGarrett / wp-3-8-replace-open-sans
Last active January 10, 2018 14:39
WordPress 3.8 - replace admin Open Sans font with your own version
function replace_open_sans() {
// Kill the original style
wp_deregister_style('open-sans');
// Replace it with your own (just as an example, I included only the 300 weight)
wp_register_style( 'open-sans', 'http://fonts.googleapis.com/css?family=Open+Sans:300' );
wp_enqueue_style( 'open-sans');
}
add_action( 'wp_enqueue_scripts', 'replace_open_sans' );
// Thanks to @timkinnane
add_action( 'admin_enqueue_scripts', 'replace_open_sans' );
@paulruescher
paulruescher / Extend Recent Posts
Created June 26, 2012 19:02
Used this to change the output of WordPress' Recent Posts Widget
/**
* Extend Recent Posts Widget
*
* Adds different formatting to the default WordPress Recent Posts Widget
*/
Class My_Recent_Posts_Widget extends WP_Widget_Recent_Posts {
function widget($args, $instance) {
@jwlawrence
jwlawrence / hCard markup
Created February 10, 2011 22:32
Contact Info with hCard Microformats
<h2>Contact Me</h2>
<address class="vcard"> <!-- replace address tag with div if used to contact anyone other than site owner -->
<h3 class="fn">John Doe</h3>
<p><a class="email" href="mailto:johndoe@example.com">johndoe@example.com</a></p>
<p class="tel">123-456-7890</p>
<ul class="adr">
<li class="street-address">123 Street Name</li>
<li class="locality">City</li>
<li class="region">State</li>
<li class="postal-code">12345</li>