Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Quarterly Update
Check 5/5/16 email for purple/green descriptions of work and 7/13/16
email for clarifications
  • Loading branch information
bcd04001 committed Jul 14, 2016
1 parent 0d160c3 commit 2450e21
Show file tree
Hide file tree
Showing 11 changed files with 1,502 additions and 605 deletions.
142 changes: 142 additions & 0 deletions archive.php
@@ -0,0 +1,142 @@
<?php
/**
* The template for displaying Archive pages.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package cornerstone
*/

get_header(); ?>
<div id="page-archive">
<div class="col-sm-12">
<div class="col-md-9 col-md-push-3">
<section id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php if ( have_posts() ) : ?>
<header class="entry-header">

<h1 class="page-title">
<?php
if ( is_category() ) :
single_cat_title();

elseif ( is_tag() ) :
single_tag_title();

elseif ( is_author() ) :
printf( __( 'Author: %s', 'cs' ), '<span class="vcard">' . get_the_author() . '</span>' );

elseif ( is_day() ) :
printf( __( 'Day: %s', 'cs' ), '<span>' . get_the_date() . '</span>' );

elseif ( is_month() ) :
printf( __( 'Month: %s', 'cs' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'cs' ) ) . '</span>' );

elseif ( is_year() ) :
printf( __( 'Year: %s', 'cs' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'cs' ) ) . '</span>' );

elseif ( is_tax( 'post_format', 'post-format-aside' ) ) :
_e( 'Asides', 'cs' );

elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) :
_e( 'Galleries', 'cs');

elseif ( is_tax( 'post_format', 'post-format-image' ) ) :
_e( 'Images', 'cs');

elseif ( is_tax( 'post_format', 'post-format-video' ) ) :
_e( 'Videos', 'cs' );

elseif ( is_tax( 'post_format', 'post-format-quote' ) ) :
_e( 'Quotes', 'cs' );

elseif ( is_tax( 'post_format', 'post-format-link' ) ) :
_e( 'Links', 'cs' );

elseif ( is_tax( 'post_format', 'post-format-status' ) ) :
_e( 'Statuses', 'cs' );

elseif ( is_tax( 'post_format', 'post-format-audio' ) ) :
_e( 'Audios', 'cs' );

elseif ( is_tax( 'post_format', 'post-format-chat' ) ) :
_e( 'Chats', 'cs' );

elseif ( is_tax( 'group') || is_tax('persontag')):
global $wp_query;
$term = $wp_query->get_queried_object();
$name = $term->name;
echo $name;

else :
_e( 'Archives', 'cs' );

endif;
?>
</h1>
<?php
// Show an optional term description.
$term_description = term_description();
if ( ! empty( $term_description ) ) :
printf( '<div class="taxonomy-description">%s</div>', $term_description );
endif;
?>
</header><!-- .page-header -->
<hr />
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>

<?php
if ( is_tax( 'group') || is_tax('persontag')){
get_template_part( 'content', 'person' );
} else {
/* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
}
?>

<?php endwhile; ?>

<?php cs_paging_nav(); ?>

<?php else : ?>

<?php get_template_part( 'content', 'none' ); ?>

<?php endif; ?>

</main><!-- #main -->
</section><!-- #primary -->
</div>
<div id="page-sidebar" class="col-sm-3 col-md-pull-9 widget-area" role="complementary">
<?php if ( ! dynamic_sidebar( 'sidebar' ) ) : ?>

<aside id="search" class="widget widget_search">
<?php get_search_form(); ?>
</aside>

<aside id="archives" class="widget">
<h1 class="widget-title"><?php _e( 'Archives', 'cs' ); ?></h1>
<ul>
<?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
</ul>
</aside>

<aside id="meta" class="widget">
<h1 class="widget-title"><?php _e( 'Meta', 'cs' ); ?></h1>
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<?php wp_meta(); ?>
</ul>
</aside>

<?php endif; // end sidebar widget area ?>
</div><!-- #secondary -->
</div>
</div>
<?php get_footer(); ?>
72 changes: 36 additions & 36 deletions content-presspage-top.php
@@ -1,37 +1,37 @@
<div id="presstop">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="row">
<div class="col-sm-6">
<?php
$presslink = press_link(get_the_ID());
$external_link = get_post_meta(get_the_ID(),'external_link');
if((strlen(get_the_content()) > 0 || !empty($external_link)) && has_post_thumbnail()) {
echo'<a href="'.$presslink.'">'.get_the_post_thumbnail().'</a>';
} elseif(has_post_thumbnail()) {
the_post_thumbnail();
} else {
echo '<p>Missing Featured Image for this post.</p>';
}
?>
</div>
<div class="col-sm-6">
<header class="entry-header">
<h4 class="entry-title">
<?php
if(strlen(get_the_content()) > 0 || !empty($external_link)) {
echo'<a href="'.$presslink.'">'.get_the_title().'</a>';
} else {
the_title();
}
?>
</h4>
</header>
<div class="entry-content clearfix">
<?php the_content(); ?>
</div>

</div>

</div>
</article>
<div id="presstop">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="row">
<div class="col-md-6">
<?php
$presslink = press_link(get_the_ID());
$external_link = get_post_meta(get_the_ID(),'external_link');
if((strlen(get_the_content()) > 0 || !empty($external_link)) && has_post_thumbnail()) {
echo'<a href="'.$presslink.'">'.get_the_post_thumbnail().'</a>';
} elseif(has_post_thumbnail()) {
the_post_thumbnail();
} else {
echo '<p>Missing Featured Image for this post.</p>';
}
?>
</div>
<div class="col-md-6">
<header class="entry-header">
<h4 class="entry-title">
<?php
if(strlen(get_the_content()) > 0 || !empty($external_link)) {
echo'<a href="'.$presslink.'">'.get_the_title().'</a>';
} else {
the_title();
}
?>
</h4>
</header>
<div class="entry-content clearfix">
<?php the_content(); ?>
</div>

</div>

</div>
</article>
</div>
86 changes: 74 additions & 12 deletions content-single.php
Expand Up @@ -13,7 +13,7 @@

<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
<div class="entry-meta">
<?php cs_posted_on(); ?>
<?php bus_posted_on(get_the_category(get_the_ID())); ?>
</div><!-- .entry-meta -->

<?php /*if ( has_post_thumbnail() ) {
Expand All @@ -24,7 +24,20 @@
</header><!-- .entry-header -->

<div class="entry-content clearfix subpage">

<div class="sharelines">
<div class="shareline-twitter">
<?php
$shareline = get_post_meta( $post->ID, 'shareline', true);
if(empty($shareline)) $shareline = get_the_title();

?>
<a href="#" onclick="window.open('https://twitter.com/intent/tweet?text=<?php echo urlencode(preg_replace("/&#?[a-z0-9]+;/i","",html_entity_decode($shareline)));?>&url=<?php echo urlencode(get_permalink()); ?>&via=UConnBusiness', 'Twitter', 'width=500,height=500');"><span class="social social-twitter"></span> <span><?php echo $shareline; ?></span></a>
</div>

<div class="shareline-facebook">
<a href="http://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>"><span class="social social-facebook"></span><span><?php echo $shareline; ?></span></a>
</div>
</div>

<?php the_content(); ?>

Expand All @@ -41,25 +54,37 @@
<footer class="entry-footer">
<?php
/* translators: used between list items, there is a space after the comma */
$category_list = get_the_category_list( __( ', ', 'cs' ) );

$categories = get_the_category(get_the_ID());
$cats = array();
$catids = array();
foreach($categories as $cat){
$parent = get_category($cat->parent);
if($parent->slug != 'authors'){
$cats[] = '<a href="'.esc_url( get_category_link($cat->term_id) ).'" title="'.$cat->name.'">'.$cat->name.'</a>';
$catids[] = $cat->term_id;
}
}
if(count($cats) > 0){
$category_list = implode(', ', $cats);
}
//$category_list = get_the_category_list( __( ', ', 'cs' ) );
/* translators: used between list items, there is a space after the comma */
$tag_list = get_the_tag_list( '', __( ', ', 'cs' ) );

if ( ! cs_categorized_blog() ) {
// This blog only has 1 category so we just need to worry about tags in the meta text
if ( '' != $tag_list ) {
$meta_text = __( 'This entry was tagged %2$s.', 'cs' );
$meta_text = __( '<div class="col-sm-2">Tags:</div><div class="col-sm-10"> %2$s.</div>', 'cs' );
} else {
$meta_text = __( '', 'cs' );
}

} else {
// But this blog has loads of categories so we should probably display them here
if ( '' != $tag_list ) {
$meta_text = __( 'This entry was posted in %1$s and tagged %2$s.', 'cs' );
$meta_text = __( '<div class="col-sm-2">Categories:</div><div class="col-sm-10"> %1$s</div> <div class="col-sm-2">Tags:</div><div class="col-sm-10"> %2$s</div>', 'cs' );
} else {
$meta_text = __( 'This entry was posted in %1$s.', 'cs' );
$meta_text = __( 'Categories: %1$s.', 'cs' );
}

} // end check for categories on this blog
Expand All @@ -75,13 +100,50 @@

<div id="social-buttons">

Share on:&nbsp; <a href="http://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>"><img src="<?php echo get_stylesheet_directory_uri().'/img/asset.f.logo.lg.png';?>" alt="facebook" />Facebook</a>
<a href="http://twitter.com/share?url=<?php the_permalink(); ?>&text=<?php echo get_the_title(); ?>"><img src="<?php echo get_stylesheet_directory_uri().'/img/twitter-bird-white-on-blue.png';?>" alt="Twitter" />Twitter </a>
<a href="http://www.linkedin.com/shareArticle?url=<?php the_permalink(); ?>&title=<?php echo get_the_title(); ?>&source=<?php the_permalink(); ?>"> <img src="<?php echo get_stylesheet_directory_uri().'/img/linkedin.png';?>" alt="LinkedIn" />LinkedIn</a>
<a href="mailto:?subject=Shared from business.uconn.edu&amp;body=<?php echo get_the_title(); ?>%0D%0A%0D%0A<?php the_permalink(); ?>"><img src="<?php echo get_stylesheet_directory_uri().'/img/email-icon.png';?>" alt="email" />Email</a>
<div class="col-sm-2">Share on:</div>
<div class="col-sm-10 social-section">
<a href="http://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>"><img src="<?php echo get_stylesheet_directory_uri().'/img/asset.f.logo.lg.png';?>" alt="facebook" />Facebook</a>
<a href="http://twitter.com/share?url=<?php the_permalink(); ?>&text=<?php echo get_the_title(); ?>"><img src="<?php echo get_stylesheet_directory_uri().'/img/twitter-bird-white-on-blue.png';?>" alt="Twitter" />Twitter </a>
<a href="http://www.linkedin.com/shareArticle?url=<?php the_permalink(); ?>&title=<?php echo get_the_title(); ?>&source=<?php the_permalink(); ?>"> <img src="<?php echo get_stylesheet_directory_uri().'/img/linkedin.png';?>" alt="LinkedIn" />LinkedIn</a>
<a href="mailto:?subject=Shared from business.uconn.edu&amp;body=<?php echo get_the_title(); ?>%0D%0A%0D%0A<?php the_permalink(); ?>"><img src="<?php echo get_stylesheet_directory_uri().'/img/email-icon.png';?>" alt="email" />Email</a>
</div>
</div>

<?php
$printthis = get_post_meta( $post->ID, 'printthis', true);
if(strlen($printthis) > 0 || $printthis == 'false') echo '<form>
<input class="printbutton" type="button" value="Print this page" onClick="window.print()">
</form>';
?>
<hr />

<div class="related-wrap clearfix">
<h4>You might be interested in:</h4>
<?php
$query = new WP_Query( array( 'category__or' => $catids ,
'meta_query' => array(
array(
'key' => '_thumbnail_id',
'compare' => 'EXISTS'
),
)) );
$posts = $query->get_posts();
$count = 0;
foreach($posts as $relatedpost){
if(get_the_ID() == $relatedpost->ID) continue;
$count++;
if($count > 3) break;
?>
<div class="relatedpost col-sm-4">
<a href="<?php echo esc_url( get_permalink($relatedpost->ID) ); ?>"><?php echo get_the_post_thumbnail($relatedpost->ID); ?></a>
<a href="<?php echo esc_url( get_permalink($relatedpost->ID) ); ?>" class="relatedtitle"><h5><?php echo get_the_title($relatedpost->ID); ?></h5></a>
</div>
<?php
}
?>

</div>

<hr />

</footer><!-- .entry-footer -->
</article><!-- #post-## -->

0 comments on commit 2450e21

Please sign in to comment.