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
Adding styles for linkedin shareline
  • Loading branch information
bcd04001 committed Aug 30, 2016
1 parent a82b56a commit 081a8b2
Show file tree
Hide file tree
Showing 3 changed files with 219 additions and 164 deletions.
320 changes: 160 additions & 160 deletions content-single.php
@@ -1,160 +1,160 @@
<?php
// This is used when viewing a single post.
?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php /* if ( has_post_thumbnail() ) {
echo '<div class="row">';
echo '<div class="col-sm-2">';
the_post_thumbnail();
echo '</div>';
echo '<div class="col-sm-10">';
} */?>

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

<?php /*if ( has_post_thumbnail() ) {
echo '</div>';
echo '</div>';
} */?>

</header><!-- .entry-header -->

<div class="entry-content clearfix subpage">
<div class="sharelines">
<?php
$twittershareline = get_post_meta( $post->ID, 'twittershareline', true);
if(empty($twittershareline)) $twittershareline = get_the_title();
$facebookshareline = get_post_meta( $post->ID, 'facebookshareline', true);
if(empty($facebookshareline)) $facebookshareline = get_the_title();
$linkedinshareline = get_post_meta( $post->ID, 'linkedinshareline', true);
if(empty($linkedinshareline)) $linkedinshareline = get_the_title();

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


<div class="shareline-linkedin">
<a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo urlencode(the_permalink()); ?>&title=<?php echo $linkedinshareline; ?>&summary=<?php echo urlencode(get_the_excerpt()); ?>&source=UConn-Aurora"><span class="social social-linkedin"></span><span><?php echo $linkedinshareline; ?></span></a>
</div>
</div>

<?php the_content(); ?>



<?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>

<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>


<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-## -->
<?php
// This is used when viewing a single post.
?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php /* if ( has_post_thumbnail() ) {
echo '<div class="row">';
echo '<div class="col-sm-2">';
the_post_thumbnail();
echo '</div>';
echo '<div class="col-sm-10">';
} */?>

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

<?php /*if ( has_post_thumbnail() ) {
echo '</div>';
echo '</div>';
} */?>

</header><!-- .entry-header -->

<div class="entry-content clearfix subpage">
<div class="sharelines">
<?php
$twittershareline = get_post_meta( $post->ID, 'twittershareline', true);
if(empty($twittershareline)) $twittershareline = get_the_title();
$facebookshareline = get_post_meta( $post->ID, 'facebookshareline', true);
if(empty($facebookshareline)) $facebookshareline = get_the_title();
$linkedinshareline = get_post_meta( $post->ID, 'linkedinshareline', true);
if(empty($linkedinshareline)) $linkedinshareline = get_the_title();

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


<div class="shareline-linkedin">
<a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo urlencode(the_permalink()); ?>&title=<?php echo $linkedinshareline; ?>&summary=<?php echo urlencode(get_the_excerpt()); ?>&source=UConn-Aurora"><span class="social social-linked-in"></span><span><?php echo $linkedinshareline; ?></span></a>
</div>
</div>

<?php the_content(); ?>



<?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>

<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>


<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-## -->
28 changes: 26 additions & 2 deletions css/executive.css
Expand Up @@ -11918,9 +11918,7 @@ h1.entry-title {
margin-right: 3px;
}
#page-single .shareline-facebook, #page-archive .shareline-facebook, #page-blog-set .shareline-facebook {
border-bottom: 1px solid #ededed;
border-top: 1px solid #ededed;
margin-bottom: 20px;
padding: 6px 0 4px;
}
#page-single .shareline-facebook a, #page-archive .shareline-facebook a, #page-blog-set .shareline-facebook a {
Expand All @@ -11943,6 +11941,32 @@ h1.entry-title {
margin-top: -2px;
margin-right: 3px;
}
#page-single .shareline-linkedin, #page-archive .shareline-linkedin, #page-blog-set .shareline-linkedin {
border-bottom: 1px solid #ededed;
border-top: 1px solid #ededed;
margin-bottom: 20px;
padding: 6px 0 4px;
}
#page-single .shareline-linkedin a, #page-archive .shareline-linkedin a, #page-blog-set .shareline-linkedin a {
color: #555;
display: inline-block;
padding-top: 2px;
text-decoration: none;
}
#page-single .shareline-linkedin a:hover, #page-archive .shareline-linkedin a:hover, #page-blog-set .shareline-linkedin a:hover {
color: #20a1da;
text-decoration: underline;
}
#page-single .shareline-linkedin a:hover .social-linked-in::before, #page-archive .shareline-linkedin a:hover .social-linked-in::before, #page-blog-set .shareline-linkedin a:hover .social-linked-in::before {
color: #20a1da;
}
#page-single .shareline-linkedin a .social-linked-in::before, #page-archive .shareline-linkedin a .social-linked-in::before, #page-blog-set .shareline-linkedin a .social-linked-in::before {
font-size: 20px;
color: #555;
display: inline-block;
margin-top: -2px;
margin-right: 3px;
}
#page-single .social, #page-archive .social, #page-blog-set .social {
margin-right: 6px;
}
Expand Down

0 comments on commit 081a8b2

Please sign in to comment.