Skip to content

Instantly share code, notes, and snippets.

@jiceb
Created February 10, 2013 11:39
Show Gist options
  • Select an option

  • Save jiceb/4749320 to your computer and use it in GitHub Desktop.

Select an option

Save jiceb/4749320 to your computer and use it in GitHub Desktop.
<?php
// http://speckyboy.com/2012/08/07/using-wordpress-to-create-a-micro-site-within-an-existing-theme
function magazine_post_type() {
register_post_type( 'magazine_', array(
'labels' => array(
'name' => __('Magazine Posts'),
'singular_name' => __('Magazine Edition'),
'add_new_item' => __('Create a New Edition' )
),
'exclude_from_search' => true,
'capability_type' => 'page',
'has_archive' => true,
'menu_position' => 10,
'public' => true,
'publicly_queryable' => false,
'rewrite' => array('slug' => 'magazine', 'with_front' => true),
'show_ui' => true,
'supports' => array('editor', 'title', 'thumbnail', 'excerpt'),
));
}
add_action( 'init', 'magazine_post_type' );
function magazine_edition_styles() {
if(is_post_type_archive('magazine_') || is_singular('magazine_')) {
wp_dequeue_style('master');
wp_enqueue_style('magazine', THEME_CSS_URI . '/magazine.css', null, '0.1');
}
}
add_action('wp_print_styles', 'magazine_edition_styles');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment