Skip to content

Commit

Permalink
Merge branch 'release/1.6.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
Misplon committed Dec 31, 2018
2 parents 0d1730a + 7858278 commit c4b5d1a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 41 deletions.
59 changes: 31 additions & 28 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,33 +46,38 @@ function siteorigin_north_display_logo() {
* Display a retina ready logo
*/
function siteorigin_north_display_retina_logo( $attr ){
$logo = siteorigin_setting( 'branding_logo' );
if ( current_filter() == 'wp_get_attachment_image_attributes' ) {
if ( ! isset( $attr['class'] ) || $attr['class'] != 'custom-logo' ) {
return $attr;
}
}
$retina = siteorigin_setting( 'branding_retina_logo' );

if( ! empty( $retina ) ) {
if ( ! empty( $retina ) ) {
$logo = siteorigin_setting( 'branding_logo' );
// Check if the user set a branding logo and if they didn't, default to the site identity logo.
if ( empty( $logo ) ) {
$logo = get_theme_mod( 'custom_logo' );
}

$srcset = array();

$logo_src = wp_get_attachment_image_src( $logo, 'full' );
$retina_src = wp_get_attachment_image_src( $retina, 'full' );

if( ! empty( $logo_src ) ) {
if ( ! empty( $logo_src ) ) {
$srcset[] = $logo_src[0] . ' 1x';
}

if( ! empty( $logo_src ) ) {
$srcset[] = $retina_src[0] . ' 2x';
}

if( ! empty( $srcset ) ) {
if ( ! empty( $srcset ) ) {
$attr['srcset'] = implode( ',', $srcset );
}
}

return $attr;
}
endif;
add_filter( 'siteorigin_north_logo_attributes', 'siteorigin_north_display_retina_logo', 10, 1 );
add_filter( 'siteorigin_north_logo_attributes', 'siteorigin_north_display_retina_logo' );
add_filter( 'wp_get_attachment_image_attributes', 'siteorigin_north_display_retina_logo' );

if ( ! function_exists( 'siteorigin_north_the_post_navigation' ) ) :
/**
Expand Down Expand Up @@ -131,7 +136,6 @@ function siteorigin_north_post_meta() {
number_format_i18n( get_comments_number() )
);


if ( siteorigin_setting( 'blog_display_date' ) ) {
?>
<li class="posted-on">
Expand Down Expand Up @@ -226,15 +230,15 @@ function siteorigin_north_posts_pagination() {
$args = array(
'next_text' => '<span class="north-icon-double-previous"></span>',
'prev_text' => '<span class="north-icon-double-next"></span>',
'end_size' => 3,
'mid_size' => 3
'end_size' => 3,
'mid_size' => 3
);
} else {
$args = array(
'next_text' => '<span class="north-icon-double-next"></span>',
'prev_text' => '<span class="north-icon-double-previous"></span>',
'end_size' => 3,
'mid_size' => 3
'end_size' => 3,
'mid_size' => 3
);
}

Expand Down Expand Up @@ -298,19 +302,19 @@ function siteorigin_north_comment( $comment, $args, $depth ) {
?>
<li <?php comment_class() ?> id="comment-<?php comment_ID() ?>">
<?php $type = get_comment_type($comment->comment_ID); ?>
<?php if($type == 'comment') : ?>
<?php if ( $type == 'comment' ) : ?>
<div class="avatar-container">
<?php echo get_avatar(get_comment_author_email(), 80) ?>
</div>
<?php endif; ?>

<div class="comment-container">
<?php if( $depth <= $args['max_depth'] ) : ?>
<?php if ( $depth <= $args['max_depth'] ) : ?>
<?php comment_reply_link( array('depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ?>
<?php endif; ?>

<div class="info">
<?php if( is_rtl() ) : ?>
<?php if ( is_rtl() ) : ?>
<span class="date"><?php comment_date(); ?></span>
-
<span class="author"><?php comment_author_link(); ?></span>
Expand Down Expand Up @@ -394,9 +398,9 @@ function siteorigin_north_custom_icon( $icon, $class ) {
* Displays SVG icons.
*/
function siteorigin_north_display_icon( $type ) {
switch( $type ) {
switch ( $type ) {
case 'menu':
if ( siteorigin_setting( 'icons_menu' ) ): ?>
if ( siteorigin_setting( 'icons_menu' ) ) : ?>
<?php siteorigin_north_custom_icon( 'icons_menu', 'svg-icon-menu' ); ?>
<?php else : ?>
<div class="icon-menu">
Expand All @@ -407,12 +411,12 @@ function siteorigin_north_display_icon( $type ) {
<?php endif;
break;

case 'close' :
case 'close':
if ( siteorigin_setting( 'icons_close_search' ) ): ?>
<?php siteorigin_north_custom_icon( 'icons_close_search', 'svg-icon-close' ); ?>
<?php else : ?>
<svg version="1.1" class="svg-icon-close" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="12px" y="12px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<path class="circle" d="M22.1,7.7c-0.6-1.4-1.4-2.5-2.3-3.5c-1-1-2.2-1.8-3.5-2.3C14.9,1.3,13.5,1,12,1S9.1,1.3,7.7,1.9
C6.4,2.5,5.2,3.2,4.2,4.2c-1,1-1.8,2.2-2.3,3.5C1.3,9.1,1,10.5,1,12c0,1.5,0.3,2.9,0.9,4.3c0.6,1.4,1.4,2.5,2.3,3.5
c1,1,2.2,1.8,3.5,2.3C9.1,22.7,10.5,23,12,23s2.9-0.3,4.3-0.9c1.4-0.6,2.5-1.4,3.5-2.3c1-1,1.8-2.2,2.3-3.5
Expand All @@ -428,28 +432,27 @@ function siteorigin_north_display_icon( $type ) {
<?php endif;
break;

case 'up-arrow' :
case 'up-arrow':
if( siteorigin_setting('icons_scroll_to_top') ) : ?>
<?php siteorigin_north_custom_icon( 'icons_scroll_to_top', 'svg-icon-to-top' ); ?>
<?php else : ?>
<svg version="1.1" class="svg-icon-to-top" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<path class="st0" d="M12,2c0.3,0,0.5,0.1,0.7,0.3l7,7C19.9,9.5,20,9.7,20,10c0,0.3-0.1,0.5-0.3,0.7S19.3,11,19,11
c-0.3,0-0.5-0.1-0.7-0.3L13,5.4V21c0,0.3-0.1,0.5-0.3,0.7S12.3,22,12,22s-0.5-0.1-0.7-0.3S11,21.3,11,21V5.4l-5.3,5.3
C5.5,10.9,5.3,11,5,11c-0.3,0-0.5-0.1-0.7-0.3C4.1,10.5,4,10.3,4,10c0-0.3,0.1-0.5,0.3-0.7l7-7C11.5,2.1,11.7,2,12,2z"/>
c-0.3,0-0.5-0.1-0.7-0.3L13,5.4V21c0,0.3-0.1,0.5-0.3,0.7S12.3,22,12,22s-0.5-0.1-0.7-0.3S11,21.3,11,21V5.4l-5.3,5.3
C5.5,10.9,5.3,11,5,11c-0.3,0-0.5-0.1-0.7-0.3C4.1,10.5,4,10.3,4,10c0-0.3,0.1-0.5,0.3-0.7l7-7C11.5,2.1,11.7,2,12,2z"/>
</svg>
<?php endif;
break;

case 'search':
if ( siteorigin_setting( 'icons_search' ) ): ?>
if ( siteorigin_setting( 'icons_search' ) ) : ?>
<?php siteorigin_north_custom_icon( 'icons_search', 'svg-icon-search' ); ?>
<?php else : ?>
<svg version="1.1" class="svg-icon-search" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32" viewBox="0 0 32 32">
<path d="M20.943 4.619c-4.5-4.5-11.822-4.5-16.321 0-4.498 4.5-4.498 11.822 0 16.319 4.007 4.006 10.247 4.435 14.743 1.308 0.095 0.447 0.312 0.875 0.659 1.222l6.553 6.55c0.953 0.955 2.496 0.955 3.447 0 0.953-0.951 0.953-2.495 0-3.447l-6.553-6.551c-0.347-0.349-0.774-0.565-1.222-0.658 3.13-4.495 2.7-10.734-1.307-14.743zM18.874 18.871c-3.359 3.357-8.825 3.357-12.183 0-3.357-3.359-3.357-8.825 0-12.184 3.358-3.359 8.825-3.359 12.183 0s3.359 8.825 0 12.184z"></path>
</svg>
<?php endif;
break;

}
}
endif;
Expand All @@ -459,7 +462,7 @@ function siteorigin_north_display_icon( $type ) {
* Display's breadcrumbs supported by Yoast SEO & Breadcrumb NavXT.
*/
function siteorigin_north_breadcrumbs() {
if( function_exists('bcn_display') ) {
if ( function_exists('bcn_display') ) {
?><div class="breadcrumbs">
<?php bcn_display(); ?>
</div><?php
Expand Down
4 changes: 4 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ Original design files are available on [Google Drive](https://drive.google.com/f

== Changelog ==

= 1.6.4 - 31 December 2018 =
* Resolved Site Identity Custom Logo not being being replaced by Retina Logo when added.
* Excluded the logo from the global img selector.

= 1.6.3 - 24 December 2018 =
* Resolved error in theme folder naming causing a 404 error on WordPress.org.

Expand Down
12 changes: 5 additions & 7 deletions sass/elements/_elements.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ html {

*,
*:before,
*:after { /* Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */
*:after { // Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/.
box-sizing: inherit;
}

body {
background: $color__background-body; /* Fallback for when there is no custom background color defined. */
background: $color__background-body; // Fallback for when there is no custom background color defined.
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
Expand Down Expand Up @@ -37,11 +37,9 @@ figure {
margin-right: 0;
}

#topbar-widgets, .site-content, .site-footer {
img {
height: auto; /* Make sure images are scaled correctly. */
max-width: 100%; /* Adhere to container width. */
}
img:not(.size-full):not(.custom-logo) {
height: auto; // Make sure images are scaled correctly.
max-width: 100%; // Adhere to container width.
}

code {
Expand Down
8 changes: 2 additions & 6 deletions style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c4b5d1a

Please sign in to comment.