This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* flush all theme modifications; check via get_theme_mods() */ | |
// remove_theme_mods(); | |
/* flush all but menus */ | |
// remove_theme_mod('header_textcolor'); | |
// remove_theme_mod('background_color'); | |
// remove_theme_mod('background_image'); | |
// remove_theme_mod('background_position_x'); | |
// remove_theme_mod('background_attachment'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Create an array of data to pass */ | |
$obj = array( | |
'foo' => $foo, | |
'bar' => $bar, | |
'multifoo' => array( 'foo1', 'foo2' ) | |
); | |
/* Enqueue javascript (assuming jQuery has been enqueued already) */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Template Name: CAUTION - Bulk Update Page Slugs | |
SECURITY FEATURE: Will only update pages with a given author! | |
1. Create a new user with username "bulkupdater". | |
2. Assign all pages you need to update to author bulkupdater. | |
3. Create a new page, assign this template and open it in the browser. | |
4. You'll see a preview of what's going to happen. | |
5. Set $update_slugs_now to true and relaod the page in your browser to perform the update. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Allow direct access to video and image files in a protected directory | |
# Props http://stackoverflow.com/a/9078460?stw=2 | |
<FilesMatch "\.(mp4|ogv|webm|jpg|png)$"> | |
Satisfy any | |
order allow,deny | |
allow from all | |
</FilesMatch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Removes file version queries from script/stylesheet calls. | |
* http://wordpress.stackexchange.com/a/96325/23011 | |
* | |
* Enhanced to keep query of google font stylesheets: | |
* Removes “?ver=3.5.1” from http://domain.tld/wp-content/themes/theme/stlye.css?ver=3.5.1 | |
* Leaves http://fonts.googleapis.com/css?family=MyFont untouched. | |
*/ | |
add_filter( 'script_loader_src', 'gp130419_remove_script_version', 15, 1 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Prepend a selector to the first level of nested selectors. | |
* Comments demonstrate compiled CSS. | |
*/ | |
.foo { | |
/* .foo */ | |
.bar { | |
/* .foo .bar */ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Pagination for a parent page and their child pages. | |
* Use as gp130428_link_pages() in your template file. | |
* Optionally limit to a particular parent page by passing its ID (i.e. 123) to the function: gp130428_link_pages( 123 ) | |
* | |
*/ | |
function gp130428_paginate_parent_children( $parent = null ) { | |
global $post; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Dynamic copyright date. | |
* | |
* Dynamic copyright date depending on | |
* when the first post was published on your site. | |
* | |
* Derived from: http://alex.leonard.ie/2010/07/27/wordpress-tip-get-the-date-of-your-first-post/ | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! = $rembase: 14px | |
-------------------------------------------------------------- | |
* hmtl { font-size: 87.5%; } | |
* body { font-size: 14px; font-size: 1rem; line-height: 1; } | |
* 4px 0.28571429rem | |
* 8px 0.571428571rem | |
* 12px 0.857142857rem | |
* 13px 0.928571429rem | |
* 14px 1rem | |
* 16px 1.142857143rem |