This commit is contained in:
nikolark committed 2013-06-17 11:04:15 +02:00
1 parent bbb9d34e7f
commit fc5281af2d
2 files changed
+90 -2

No files matched your search

+46 -2
View File
@@ -54,8 +54,7 @@ function new_excerpt_more($more) {
}
add_filter('excerpt_more', 'new_excerpt_more');
/* post type */
// Register Custom Post Type
/* Artist post type */
function studio_artists_post_type() {
$labels = array(
'name' => _x( 'Artists', 'Post Type General Name', 'studio' ),
@@ -100,4 +99,49 @@ function studio_artists_post_type() {
// Hook into the 'init' action
add_action( 'init', 'studio_artists_post_type', 0 );
/* Event post type */
function studio_events_post_type() {
$labels = array(
'name' => _x( 'Events', 'Post Type General Name', 'studio' ),
'singular_name' => _x( 'Event', 'Post Type Singular Name', 'studio' ),
'menu_name' => __( 'Event', 'studio' ),
'parent_item_colon' => __( 'Parent Event:', 'studio' ),
'all_items' => __( 'All Events', 'studio' ),
'view_item' => __( 'View Event', 'studio' ),
'add_new_item' => __( 'Add New Event', 'studio' ),
'add_new' => __( 'New Event', 'studio' ),
'edit_item' => __( 'Edit Event', 'studio' ),
'update_item' => __( 'Update Event', 'studio' ),
'search_items' => __( 'Search Events', 'studio' ),
'not_found' => __( 'No Events found', 'studio' ),
'not_found_in_trash' => __( 'No Events found in Trash', 'studio' ),
);
$args = array(
'label' => __( 'event', 'studio' ),
'description' => __( 'Event information pagews', 'studio' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', ),
'taxonomies' => array( 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
//'menu_icon' => '',
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'event', $args );
}
// Hook into the 'init' action
add_action( 'init', 'studio_events_post_type', 0 );
?>
@@ -0,0 +1,44 @@
<?php
/*
Template Name: Events page
*/
?>
<?php get_header(); ?>
<div id="content" class="template-artists">
<div id="inner-content" class="row">
<div id="main" role="main" class="small-12 columns">
<?php while ( have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" role="article">
<header class="article-header row">
<div class="small-12 columns">
<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
</div>
</header> <!-- end article header -->
<section class="entry-content">
<?php the_content(); ?>
<ul class="artists headliners small-block-grid-4">
<?php
/* Print our artists */
$query = new WP_Query( array(
'post_type' => 'event',
'orderby' => 'title',
'order' => 'asc') );
while ( $query->have_posts() ):
$query->the_post();
$artist_thumb = get_the_post_thumbnail($post->ID, 'artist-thumb');
if($artist_thumb == "") {
$artist_thumb = '<img src="http://placehold.it/228x191" />';
}
?><li class="artist-box"><a href="<?php the_permalink();?>" class="colored primary"><?php echo $artist_thumb;?><span><?php the_title(); ?></span></a></li><?php endwhile;
wp_reset_postdata();?>
</ul>
</section> <!-- end article section -->
<footer class="article-footer">
</footer> <!-- end article footer -->
</article> <!-- end article -->
<?php endwhile; ?>
</div> <!-- end #main -->
</div> <!-- end #inner-content -->
</div> <!-- end #content -->
<?php get_footer();?>