Permalink
Browse files

custom post type

Signed-off-by: Norik Davtian <norik@bigemployee.com>
  • Loading branch information...
NorikDavtian committed Apr 10, 2014
1 parent 7974d75 commit 68908f79e8d058763f3359400f787c7623f09141
Showing with 93 additions and 5 deletions.
  1. +34 −0 content-profile.php
  2. +3 −3 content-team.php
  3. +14 −0 inc/custom-post-types.php
  4. +25 −0 single-team.php
  5. +17 −2 style.css
View
@@ -0,0 +1,34 @@
<?php
/**
* The template used for displaying registered custom post type
*
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class('profile'); ?>>
<header class="entry-header">
<?php if (has_post_thumbnail()): ?>
<div id="featured-header">
<?php the_post_thumbnail('post-thumbnail', 'itemprop=image'); ?>
</div>
<?php endif; ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php $title = get_post_meta(get_the_ID(), 'title', true); ?>
<?php $facebook = get_post_meta(get_the_ID(), 'facebook', true); ?>
<?php $twitter = get_post_meta(get_the_ID(), 'twitter', true); ?>
<?php $google_plus = get_post_meta(get_the_ID(), 'google+', true); ?>
<?php $instagram = get_post_meta(get_the_ID(), 'instagram', true); ?>
<?php $youtube = get_post_meta(get_the_ID(), 'youtube', true); ?>
<?php $pinterest = get_post_meta(get_the_ID(), 'pinterest', true); ?>
<?php bigblank_print($title, '<h2><em>(', ')</em></h2>'); ?>
<?php bigblank_print($facebook, '<a href="', '"><i class="fa fa-facebook-square"></i></a>'); ?>
<?php bigblank_print($twitter, '<a href="', '"><i class="fa fa-twitter-square"></i></a>'); ?>
<?php bigblank_print($google_plus, '<a href="', '"><i class="fa fa-google-plus-square"></i></a>'); ?>
<?php bigblank_print($instagram, '<a href="', '"><i class="fa fa-instagram"></i></a>'); ?>
<?php bigblank_print($youtube, '<a href="', '"><i class="fa fa-youtube-play"></i></a>'); ?>
<?php bigblank_print($pinterest, '<a href="', '"><i class="fa fa-pinterest"></i></a>'); ?>
</header>
<section class="entry-content">
<?php the_content(); ?>
<?php edit_post_link(__('Edit', 'bigblank')); ?>
</section>
</article>
View
@@ -29,9 +29,9 @@
<?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
<div class="team-member">
<?php $slug = sanitize_title_with_dashes(get_the_title()); ?>
<h2 id="<?php echo $slug; ?>"><a class="anchor" href="#<?php echo $slug; ?>"><i class="fa fa-link"></i></a><?php the_title(); ?></h2>
<?php // $subtitle = get_post_meta(get_the_ID(), 'subtitle', true); ?>
<!--<strong class="subtitle"><?php // echo $subtitle; ?></strong>-->
<?php $title = get_post_meta(get_the_ID(), 'title', true); ?>
<?php $facebook = get_post_meta(get_the_ID(), 'facebook', true); ?>
<h2 id="<?php echo $slug; ?>"><a class="anchor" href="#<?php echo $slug; ?>"><i class="fa fa-link"></i></a><?php the_title(); ?> <?php bigblank_print($title, '<em>(',')</em>'); ?></h2>
<?php if (has_post_thumbnail()): ?>
<?php the_post_thumbnail('medium', 'class=alignright portrait'); ?>
<?php endif ?>
View
@@ -67,3 +67,17 @@ function bigblank_rewrite_flush() {
}
add_action('after_switch_theme', 'bigblank_rewrite_flush');
function bigblank_print($title='', $before = '', $after = '', $echo = true) {
if ( strlen($title) == 0 )
return;
$title = $before . $title . $after;
if ( $echo )
echo $title;
else
return $title;
}
View
@@ -0,0 +1,25 @@
<?php
/**
* The Template for displaying all single posts
*
*/
get_header();
get_header('layout');
?>
<?php
// Start the Loop.
while (have_posts()) : the_post();
/*
* Include the post format-specific template for the content. If you want to
* use this in a child theme, then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part('content', 'profile');
endwhile;
?>
<?php
get_footer('layout');
get_footer();
View
@@ -29,7 +29,7 @@ Domain Path: /languages/
* 6.3 - Entry Meta
* 6.4 - Entry Content
* 6.5 - Galleries
* 6.6 - Post Formats
* 6.6 - Custom Post Types
* 6.7 - Post/Image/Paging Navigation
* 6.8 - Attachments
* 6.9 - Archives
@@ -1736,14 +1736,29 @@ h2:hover a.anchor{
/**
* 6.6 Custom Post Type
* 6.6 Custom Post Types (Team & Profile)
* -----------------------------------------------------------------------------
*/
.team-member .portrait{
max-width: 128px;
border-radius: 50%;
box-shadow: 0 1px 2px #999;
}
.team-member h2 em,
.profile .entry-header h2 em{
font: 300 italic 0.8em/1.5 'Playfair Display', Georgia, Times, serif;
}
.profile .entry-header,
.profile .entry-header h1,
.profile .entry-header h2{
text-align: center;
}
.profile .entry-header h1{
margin-bottom: 0;
}
.profile .entry-header h2{
margin-top: 0;
}
/**

0 comments on commit 68908f7

Please sign in to comment.