Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixes to content pages and styles
  • Loading branch information
bcd04001 committed Jul 21, 2016
1 parent 6bdfea4 commit 3e00b90
Show file tree
Hide file tree
Showing 5 changed files with 336 additions and 143 deletions.
13 changes: 7 additions & 6 deletions content-single.php
Expand Up @@ -42,7 +42,7 @@
<?php the_content(); ?>


<hr/>

<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'cs' ),
Expand All @@ -52,7 +52,7 @@
</div><!-- .entry-content -->

<footer class="entry-footer">
<div class="cats-and-tags row">
<div class="cats-and-tags">
<?php
/* translators: used between list items, there is a space after the comma */
$categories = get_the_category(get_the_ID());
Expand All @@ -75,17 +75,17 @@
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 = __( '<div class="col-sm-2">Tags:</div><div class="col-sm-10"> %2$s.</div>', 'cs' );
$meta_text = __( '<div class="row"><div class="col-sm-2">Tags:</div><div class="col-sm-10"> %2$s.</div></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 = __( '<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' );
$meta_text = __( '<div class="row"><div class="col-sm-2">Categories:</div><div class="col-sm-10"> %1$s</div></div><div class="row"> <div class="col-sm-2">Tags:</div><div class="col-sm-10"> %2$s</div></div>', 'cs' );
} else {
$meta_text = __( '<div class="col-sm-2">Categories:</div><div class="col-sm-10"> %1$s</div>', 'cs' );
$meta_text = __( '<div class="row"><div class="col-sm-2">Categories:</div><div class="col-sm-10"> %1$s</div></div>', 'cs' );
}

} // end check for categories on this blog
Expand All @@ -101,14 +101,15 @@
</div>

<div id="social-buttons">

<div class="row">
<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>
</div>

<?php
Expand Down
157 changes: 84 additions & 73 deletions content.php
@@ -1,74 +1,85 @@
<?php
/**
* @package cs
*/
?>

<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?>>
<header class="entry-header">
<?php
if(strlen(get_the_content()) > 0){
the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' );
}
else{
the_title( sprintf( '<h1 class="entry-title">', esc_url( get_permalink() ) ), '</h1>' );
}
?>

<?php if ( 'post' == get_post_type() ) : ?>
<div class="entry-meta">
<?php bus_posted_on(get_the_category(get_the_ID())); ?>
</div><!-- .entry-meta -->
<?php endif; ?>
</header><!-- .entry-header -->

<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'cs' ) ); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'cs' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
<hr />
<footer class="entry-footer">
<?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
<?php
/* translators: used between list items, there is a space after the comma */
$categories = get_the_category(get_the_ID());
$cats = 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>';
}
}
if(count($cats) > 0){
$categories_list = implode(', ', $cats);
}
//$categories_list = get_the_category_list( __( ', ', 'cs' ) );
if ( $categories_list && cs_categorized_blog() ) :
?>
<span class="cat-links">
<?php printf( __( 'Categories: %1$s <br />', 'cs' ), $categories_list ); ?>
</span>
<?php endif; // End if categories ?>
<?php
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', __( ', ', 'cs' ) );
if ( $tags_list ) :
?>
<span class="tags-links">
<?php printf( __( 'Tags: %1$s', 'cs' ), $tags_list ); ?>
</span>
<?php endif; // End if $tags_list ?>
<?php endif; // End if 'post' == get_post_type() ?>

<?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'cs' ), __( '1 Comment', 'cs' ), __( '% Comments', 'cs' ) ); ?></span>
<?php endif; ?>

<?php edit_post_link( __( 'Edit', 'cs' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer -->
<?php
/**
* @package cs
*/
?>

<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?>>
<header class="entry-header">
<?php
if(strlen(get_the_content()) > 0){
the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' );
}
else{
the_title( sprintf( '<h1 class="entry-title">', esc_url( get_permalink() ) ), '</h1>' );
}
?>

<?php if ( 'post' == get_post_type() ) : ?>
<div class="entry-meta">
<?php bus_posted_on(get_the_category(get_the_ID())); ?>
</div><!-- .entry-meta -->
<?php endif; ?>
</header><!-- .entry-header -->

<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'cs' ) ); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'cs' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->

<footer class="entry-footer">

<div class="cats-and-tags">
<?php
/* translators: used between list items, there is a space after the comma */
$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 = __( '<div class="row"><div class="col-sm-2">Tags:</div><div class="col-sm-10"> %2$s.</div></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 = __( '<div class="row"><div class="col-sm-2">Categories:</div><div class="col-sm-10"> %1$s</div></div><div class="row"> <div class="col-sm-2">Tags:</div><div class="col-sm-10"> %2$s</div></div>', 'cs' );
} else {
$meta_text = __( '<div class="row"><div class="col-sm-2">Categories:</div><div class="col-sm-10"> %1$s</div></div>', 'cs' );
}

} // end check for categories on this blog

printf(
$meta_text,
$category_list,
$tag_list,
get_permalink()
);
?>

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

0 comments on commit 3e00b90

Please sign in to comment.