Skip to content

Instantly share code, notes, and snippets.

@danielpataki
Last active December 18, 2018 23:10
Show Gist options
  • Save danielpataki/5f47292f15cbc2e2d4ff to your computer and use it in GitHub Desktop.
Save danielpataki/5f47292f15cbc2e2d4ff to your computer and use it in GitHub Desktop.
Modifying Twenty Fifteen
<?php
// Author bio.
if ( is_single() && get_the_author_meta( 'description' ) ) :
get_template_part( 'author-bio' );
endif;
?>
.borderless {
padding:0px;
box-shadow:none;
background:transparent;
}
.borderless .entry-content {
padding:0px;
}
.borderless .entry-footer {
display:none;
}
.hentry {
background: #f4df30;
}
.entry-footer {
background: #303030;
color: #fff;
}
.entry-footer a {
color: #fff;
}
.after-post-section h3 {
color: #333;
font-size:1.3rem;
display:inline-block;
font-family: 'Noto Sans', sans-serif;
font-weight:700;
margin: 0 0 1em 0;
line-height: 1.2;
opacity:0.7;
text-transform: uppercase;
vertical-align: baseline;
}
.after-post-section h3::before {
content: "";
display: block;
width: 100%;
min-width: 30px;
border-top: 1px solid #ddd;
margin-bottom: 1em;
}
.after-post-section .section-content {
font-size: 0.8em;
}
<div class="after-post-section">
<h3>Image Credit</h3>
<div class="section-content">
IMAGE CREDIT HERE
</div>
</div>
add_action( 'the_content', 'my_image_credit', 12 );
function my_image_credit( $content ) {
if( is_singular() ) {
$image_credit = get_field( 'image_credit' );
if( !empty( $image_credit ) ) {
$content .= '<div class="after-post-section"><h3>Image Credit</h3><div class="section-content">' . $image_credit . '</div></div>';
}
}
return $content;
}
add_filter( 'post_class', 'borderless_post_class' );
function borderless_post_class( $classes ) {
global $post;
if( get_field( 'borderless', $post->ID ) ) {
$classes[] = 'borderless';
}
return $classes;
}
@media screen and (min-width: 59.6875em) {
.site-content {
float: left;
margin-left: 0px;
width: 70.5882%;
}
.sidebar {
float: right;
right:0;
margin-right: 0px;
max-width: 413px;
width: 29.4118%;
}
body:before {
right: 0;
left:auto;
}
.site-footer {
margin: 0 0 0 6.1%;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment