This file contains hidden or 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( 'register_post_type_args', function( $args, $post_type ) { | |
global $wp_rewrite; | |
if ( 'post' === $post_type && ! is_null( $wp_rewrite ) ) { | |
$archive_slug = 'blog'; | |
// Setting 'has_archive' ensures get_post_type_archive_template() returns an archive.php template. | |
$args['has_archive'] = $archive_slug; | |
// We have to register rewrite rules, because WordPress won't do it for us unless $args['rewrite'] is true. | |
$archive_slug = $wp_rewrite->root . $archive_slug; |
This file contains hidden or 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: Multisite Site Category | |
* Plugin URI: https://gist.github.com/brasofilo/6715423 | |
* Description: Add a custom meta option when registering new sites in WordPress Multisite. Two columns will be added to the Sites listing screen: ID and Category. Based on http://wordpress.stackexchange.com/a/50936/12615 | |
* Network: true | |
* Author: Rodolfo Buaiz | |
* Author URI: http://brasofilo.com/ | |
* Version: 1.1 |
This file contains hidden or 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 | |
# Register custom post types on the 'init' hook. | |
add_action( 'init', 'my_register_post_types' ); | |
/** | |
* Registers post types needed by the plugin. | |
* | |
* @since 1.0.0 | |
* @access public |
This file contains hidden or 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 | |
if ( !function_exists( 'wpcom_vip_load_category_base' ) ): | |
/** | |
* Enables a custom or no category base, if the site wants to use one that's not the WP.com default (/category/) | |
* | |
* Usage: | |
* wpcom_vip_load_category_base( '' ); | |
* wpcom_vip_load_category_base( 'section' ); | |
* |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Tournament Bracket Generator</title> | |
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> | |
<script src="http://underscorejs.org/underscore-min.js"></script> | |
<script> | |
$(document).on('ready', function() { | |
var knownBrackets = [2,4,8,16,32], // brackets with "perfect" proportions (full fields, no byes) |