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 | |
/* | |
* Order posts by title | |
* | |
* @see https://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts | |
* | |
* Notes: | |
* - 'zewpgists_' is a prefix for all my gists. Replace with your own. | |
* | |
*/ |
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 | |
/* | |
* Code to exclude the single event we're viewing from | |
* the events list on the widget. | |
* | |
* Notes: | |
* - Only works with the Events Calendar plugin (Modern Tribe). | |
* - 'zewpgists_' is a prefix for all my gists. Replace with your own. | |
* | |
*/ |
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
@keyframes fadein { | |
0% { | |
opacity: 0; | |
} | |
100% { | |
opacity: 1; | |
} | |
} | |
/* Each element you want to fade in in sequence should have a incremental delay in the animation - more here: https://developer.mozilla.org/en-US/docs/Web/CSS/animation */ |
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 | |
// From http://www.smashingmagazine.com/2009/08/18/10-useful-wordpress-hook-hacks/ | |
function callback($buffer) { | |
// modify buffer here, and then return the updated code | |
return $buffer; | |
} |
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
// Add a count of draft posts to the Posts menu | |
function zedejose_add_draft_count() { | |
global $menu; | |
$count_posts = wp_count_posts(); | |
$draft_posts = $count_posts->draft; | |
$menu[5][0] = $menu[5][0] . '<span class="update-plugins count-2"><span class="plugin-count">' . (int)$draft_posts . '</span></span>'; | |
} |
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 | |
class CWS_Jetpack_Modules { | |
function __construct() { | |
add_filter( 'option_jetpack_active_modules', array( $this, 'active_modules' ) ); | |
} | |
function active_modules( $modules ) { | |
$allowed_modules = array( | |
'enhanced-distribution', |
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: Hacky Taxonomy Archives | |
* Description: Don't use this on a live site, plz. Proof of concept for Aaron Holbrook. | |
* Author: Andrew Nacin | |
*/ | |
add_action( 'template_redirect', function() { | |
global $wp_rewrite; | |
$taxonomy = 'fruits'; |