Skip to content

Instantly share code, notes, and snippets.

View mestrewp's full-sized avatar

Mestre WordPress mestrewp

View GitHub Profile
@mestrewp
mestrewp / .htaccess
Created May 28, 2012 18:28
Simple, quick way to concatenate, minify, and version static files in a Wordpress theme
# Filename-based cache busting
# taken from https://github.com/h5bp/html5-boilerplate/
# This rewrites file names of the form `name.123456.js` to `name.js`
# so that the browser doesn't use the cached version when you have
# updated (but not manually renamed) the file.
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
@mestrewp
mestrewp / gist:2820471
Created May 28, 2012 18:28
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@mestrewp
mestrewp / gist:2820468
Created May 28, 2012 18:28
WordPressの記事をエクスポートするためのURL
http://example.com/wp-admin/export.php?download=true&content=all
@mestrewp
mestrewp / gist:2820465
Created May 28, 2012 18:28
Automatically Set the Featured Image in WordPress
<?php
/**
* Automatically Set the Featured Image in WordPress
* @author Jonathan Dingman
* @url http://wpforce.com/automatically-set-the-featured-image-in-wordpress/
*/
function autoset_featured() {
global $post;
$already_has_thumb = has_post_thumbnail($post->ID);