Skip to content

Instantly share code, notes, and snippets.

@saltcod
Forked from anonymous/functions.php
Created March 27, 2012 17:57
Show Gist options
  • Save saltcod/2218409 to your computer and use it in GitHub Desktop.
Save saltcod/2218409 to your computer and use it in GitHub Desktop.
functions page
<?php
/* Uncomment to put site in maintenance mode */
function wpr_maintenance_mode() {<br />
if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) {<br />
wp_die('Doing a small upgrade, please come back in about an hour!');<br />
}<br />
}<br />
add_action('get_header', 'wpr_maintenance_mode');
add_action( 'init', 'register_my_menus' );
function register_my_menus() {
register_nav_menus(
array(
'menu-1' => __( 'Menu 1' ),
'menu-2' => __( 'Menu 2' )
)
);
}
add_action( 'init', 'create_my_post_types' );
function create_my_post_types() {
register_post_type( 'News',
array(
'labels' => array(
'name' => __( 'News' ),
'singular_name' => __( 'News' )
),
'public' => true,
)
);
register_post_type( 'Shows',
array(
'labels' => array(
'name' => __( 'Shows' ),
'singular_name' => __( 'Shows' )
),
'public' => true,
)
);
}
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'sidebar1',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(array('name'=>'sidebar2',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(array('name'=>'sidebar3',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment