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 | |
/** | |
* Usage: | |
* Paste a gist link into a blog post or page and it will be embedded eg: | |
* https://gist.github.com/2926827 | |
* | |
* If a gist has multiple files you can select one using a url in the following format: | |
* https://gist.github.com/2926827?file=embed-gist.php | |
*/ |
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 | |
/* | |
* Custom styles for tiny mce | |
* HT: http://alisothegeek.com/2011/05/tinymce-styles-dropdown-wordpress-visual-editor/ | |
*/ | |
add_filter( 'mce_buttons_2', 'my_mce_buttons_2' ); | |
function my_mce_buttons_2( $buttons ) { | |
array_unshift( $buttons, 'styleselect' ); |
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 | |
add_filter( 'style_loader_tag', 'style_loader_tag_ccs', 10, 2 ); | |
/** | |
* Add support for non IE conditional comments | |
* | |
* Trac ticket: http://core.trac.wordpress.org/ticket/16118 | |
* | |
* Usage: |
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 | |
// replace 'post' with the id of the post type you want for your main listing | |
add_action( 'pre_get_posts', 'modify_main_query' ); | |
function modify_main_query( $query ) { | |
if ( $query !== $wp_the_query || is_admin() ) | |
return $query; | |
$query->query_vars[ 'post_type' ] = '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 | |
/* | |
Plugin Name: Exclude Categories | |
Description: Adds a list of checkboxes on the reading settings page to explicitly exclude categories from the main blog listing. | |
Version: 0.1 | |
Author: Robert O'Rourke | |
License: GPLv2 or later | |
*/ |
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 | |
/* | |
Plugin Name: Blog Categories | |
Description: Adds a list of checkboxes on the reading settings page to explicitly set which categories show up in the main blog listing. | |
Version: 0.1 | |
Author: Robert O'Rourke | |
License: GPLv2 or later | |
*/ |
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
/** | |
* Woot! | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height:100%; |
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 | |
// stickier stickies | |
function fix_sticky_posts( $stickies ) { | |
foreach( $stickies as $sticky ) | |
wp_update_post( array( 'ID' => $sticky, 'menu_order' => -1 ) ); | |
return $stickies; | |
} | |
add_filter('pre_update_option_sticky_posts', 'fix_sticky_posts'); |