Skip to content

Instantly share code, notes, and snippets.

View norcross's full-sized avatar
somone said this would be easy. someone LIED.

Norcross norcross

somone said this would be easy. someone LIED.
View GitHub Profile
@trepmal
trepmal / !note.txt
Last active August 29, 2015 14:05
return-to-top arrow, à la wp.com
Needs some love. Styles in the footer, assumptions about jQuery, yadda yadda yadda...
array(
"AF" => "Afghanistan (‫افغانستان‬‎)",
"AX" => "Åland Islands (Åland)",
"AL" => "Albania (Shqipëri)",
"DZ" => "Algeria (‫الجزائر‬‎)",
"AS" => "American Samoa",
"AD" => "Andorra",
"AO" => "Angola",
"AI" => "Anguilla",
"AQ" => "Antarctica",
@dannyb195
dannyb195 / gist:2c74017c52ef7d625c35
Created May 28, 2015 23:22
Inserting content after WP in-content paragraph (not really tested)
$content = get_post( 1558 );
$content = $content->post_content;
$content_array = explode( "\n", $content );
echo 'before<pre>';
print_r($content_array);
echo '</pre>';
foreach ( $content_array as $k => $v ) {
@chriscoyier
chriscoyier / gist:972699
Created May 14, 2011 22:20
commentcodeplugin.md

IDEA: WordPress Plugin for Improving Leaving Code in Comments

It's always quite a struggle to keep people doing it correctly on CSS-Tricks, so I'd love if there was a plugin to make it more foolproof.

The overall idea: make it so if you use <code> tags, it will come out perfectly.


1) Automatically escape code that isn't escaped

@billerickson
billerickson / gist:1204283
Created September 8, 2011 18:50
Limit metabox to specific page
<?php
// Changes to metabox array, new field 'show_on'
$meta_boxes[] = array(
'id' => 'blog-options',
'title' => 'Blog Options',
'pages' => array('page'),
'show_on' => array( 'key' => 'id', 'value' => array( 12 ) ),
'context' => 'normal',
'priority' => 'low',
<?php
add_action( 'genesis_before_loop', 'be_recipe_archive_intro', 15 );
/**
* Intro - Recipe Archive
* @author Bill Erickson
*
* (in archive-recipes.php)
*/
function be_recipe_archive_intro() {
@i3inary
i3inary / gist:1904597
Created February 24, 2012 23:33
How to Publish Production WordPress Sites on Development Urls Without Modifying Database
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
@gregrickaby
gregrickaby / functions.php
Created May 16, 2012 23:01
Thesis Child Theme
<?php
/**
* Functions.php
*
* This file handles the child theme setup and intialization.
*
* @category FMG
* @package Functions
* @author Greg Rickaby
* @since 1.0.0
@ramseyp
ramseyp / featured_img_url.php
Created June 12, 2012 20:40
Getting the URL of a featured image in WordPress
@xentek
xentek / wp-unit-tests.md
Created August 26, 2012 19:06
WordPress Unit Tests Quick Start

WordPress Unit Tests Quick Start Guide

This quick start guide is geared towards installing PHPUnit on OSX in order to run the WordPress unit tests. It uses homebrew to install PHP using homebrew-php. You can likely skip this step if you've already got php and pear installed properly.

If you use MAMP, then try these instructions to use MAMP's php and pear to install PHPUnit.

install homebrew

ruby &lt;(curl -fsSkL raw.github.com/mxcl/homebrew/go)