Skip to content

Commit

Permalink
Version 1.0.8
Browse files Browse the repository at this point in the history
* Fix site description showed when custom logo is active
* Fix missing title icon
  • Loading branch information
francgrasso committed Feb 28, 2020
1 parent 744f10b commit b64f42a
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 79 deletions.
28 changes: 17 additions & 11 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ class="site-header <?php echo esc_attr( get_theme_mod( 'yith_proteo_header_layou
<?php endif; ?>
</h1>
<?php
$yith_proteo_description = get_bloginfo( 'description', 'display' );
if ( $yith_proteo_description || is_customize_preview() ) :
?>
<p class="site-description"><?php echo $yith_proteo_description; /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ ?></p>
<?php
if ( ! has_custom_logo() ) :
$yith_proteo_description = get_bloginfo( 'description', 'display' );
if ( $yith_proteo_description || is_customize_preview() ) :
?>
<p class="site-description"><?php echo $yith_proteo_description; /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ ?></p>
<?php
endif;
endif;
else :
if ( has_custom_logo() ) :
Expand All @@ -67,13 +69,17 @@ class="site-header <?php echo esc_attr( get_theme_mod( 'yith_proteo_header_layou
</a>
</p>
<?php
endif;
if ( ! has_custom_logo() ) :
$yith_proteo_description = get_bloginfo( 'description', 'display' );
if ( $yith_proteo_description || is_customize_preview() ) :
?>
<p class="site-description"><?php echo $yith_proteo_description; /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ ?></p>
<?php
endif;
$yith_proteo_description = get_bloginfo( 'description', 'display' );
if ( $yith_proteo_description || is_customize_preview() ) :
?>
<p class="site-description"><?php echo $yith_proteo_description; /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ ?></p>
<?php endif; ?>
<?php endif; ?>
endif;
endif;
?>
</div><!-- .site-branding -->

<nav id="site-navigation" class="main-navigation">
Expand Down
3 changes: 2 additions & 1 deletion inc/customizer-inline-style.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ function yith_proteo_inline_style() {
h1,
article.page header.entry-header h1,
article:not(.has-post-thumbnail).page header.entry-header h1{
article:not(.has-post-thumbnail).page header.entry-header h1,
article.page header.entry-header .entry-title.lnr{
font-size: {$h1_font_size}px;
color: {$h1_font_color};
}
Expand Down
66 changes: 7 additions & 59 deletions inc/template-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ function yith_proteo_get_sidebar_position( $info = null ) {
function yith_proteo_print_page_titles() {
global $post;

if ( $post instanceof WP_Post && ( 'post' == $post->post_type || 'page' == $post->post_type ) ) {
$icon = ! empty( get_post_meta( $post->ID, 'title_icon', true ) ) ? '<div class="entry-title lnr ' . get_post_meta( $post->ID, 'title_icon', true ) . '"></div>' : '';
if ( ! empty( $icon ) ) {
echo $icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}

$hide_title_if_wishlist = false;

if ( function_exists( 'yith_wcwl_is_wishlist_page' ) ) {
Expand All @@ -136,65 +143,6 @@ function yith_proteo_print_page_titles() {
endif;


/**
* Add icon to titles
*
* @param $title
* @param null $id
*
* @return string
*
* @author Francesco Grasso <[email protected]>
*/
if ( ! function_exists( 'yith_proteo_show_icon_title' ) ) :
function yith_proteo_show_icon_title( $title, $id = null ) {
if ( ! is_admin() && ! is_null( $id ) ) {
$post = get_post( $id );
if ( $post instanceof WP_Post && ( 'post' == $post->post_type || 'page' == $post->post_type ) ) {
$icon = ! empty( get_post_meta( $post->ID, 'title_icon', true ) ) ? '<div class="lnr ' . get_post_meta( $post->ID, 'title_icon', true ) . '"></div>' : '';
if ( ! empty( $icon ) ) {
return $icon . $title;
}
}
}

return $title;
}
endif;

add_filter( 'the_title', 'yith_proteo_show_icon_title', 10, 2 );

/**
* Remove icon filter from nav menus
*
* @param $nav_menu
* @param $args
*
* @return mixed
*
* @author Francesco Grasso <[email protected]>
*/
function yith_proteo_remove_title_filter_nav_menu( $nav_menu, $args ) {
// we are working with menu, so remove the title filter
remove_filter( 'the_title', 'yith_proteo_show_icon_title', 10 );

return $nav_menu;
}

// this filter fires just before the nav menu item creation process
add_filter( 'pre_wp_nav_menu', 'yith_proteo_remove_title_filter_nav_menu', 10, 2 );

function yith_proteo_add_title_filter_non_menu( $items, $args ) {
// we are done working with menu, so add the title filter back
add_filter( 'the_title', 'yith_proteo_show_icon_title', 10, 2 );

return $items;
}

// this filter fires after nav menu item creation is done
add_filter( 'wp_nav_menu_items', 'yith_proteo_add_title_filter_non_menu', 10, 2 );


/**
* FULL SCREEN SEARCH
*/
Expand Down
6 changes: 3 additions & 3 deletions inc/widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

// Include the recent posts widget.
require get_template_directory() . '/inc/widgets/class-yith-proteo-recent-posts-widget.php';
require get_template_directory() . '/inc/widgets/class-yith-proteo-recent-posts-widget.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound

function yith_proteo_recent_post_widget_registration() {
unregister_widget( 'WP_Widget_Recent_Posts' );
Expand All @@ -16,7 +16,7 @@ function yith_proteo_recent_post_widget_registration() {
add_action( 'widgets_init', 'yith_proteo_recent_post_widget_registration' );

// Include the recent comments widget.
require get_template_directory() . '/inc/widgets/class-yith-proteo-recent-comments-widget.php';
require get_template_directory() . '/inc/widgets/class-yith-proteo-recent-comments-widget.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound

function yith_proteo_recent_comments_widget_registration() {
unregister_widget( 'WP_Widget_Recent_Comments' );
Expand All @@ -27,7 +27,7 @@ function yith_proteo_recent_comments_widget_registration() {


// Include the recent posts widget.
require get_template_directory() . '/inc/widgets/class-yith-proteo-social-icons.php';
require get_template_directory() . '/inc/widgets/class-yith-proteo-social-icons.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound

// register YITH_Proteo_Social_Icons widget
function register_yith_proteo_social_icons() {
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Tags: one-column, two-columns, left-sidebar, right-sidebar, wide-blocks, accessi
Requires at least: 4.9.6
Tested up to: WordPress 5.3
Requires PHP: 5.6
Stable tag: 1.0.7
Stable tag: 1.0.8
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -25,6 +25,10 @@ Proteo is a sleek, modern and “Gutenberg-friendly” e-commerce theme. Develop
== Frequently Asked Questions ==

== Changelog ==
= 1.0.8 - Feb 28 2020 =
* Fix site description showed when custom logo is active
* Fix missing title icon

= 1.0.7 - Feb 28 2020 =
* Minimum PHP is now 5.6
* Fix theme code to match PHP WordPress Coding standards
Expand Down
2 changes: 2 additions & 0 deletions sass/site/primary/_posts-and-pages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ article:not(.has-post-thumbnail).page header.entry-header {

h1 {
margin-top: 0;
display: block;
text-align: center;
}
}

Expand Down
2 changes: 1 addition & 1 deletion sass/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Author: YITH
Author URI: https://yithemes.com
Description: Proteo is a sleek, modern and “Gutenberg-friendly” e-commerce theme. Developed with a beautiful UI and a minimal design, is perfect for each kind of shop. Easy to manage and to customize, Proteo is the best solution if you want a complete e-commerce template and start quickly to sell your products with WooCommerce without a technical knowledge. Use it also for corporate site or a blog: there are no limits about what you can do with a beautiful and usable theme like this! Main features: Colors and Typography customization (Google font support), Logo customization, 3 different Header layouts, Advanced customizer theme options, Sidebar Management, Sidebar Chooser on each page and product, Page title icons, Top Bar Management, Easy main color shade chooser, Buttons style management (gradient buttons support), Footer management with multiple sidebars, WooCommerce support, Shop Theme Options, Custom WooCommerce messages and animated WooCommerce alert notices, Two cart page layouts, Bootstrap grid system, CSS animations, Gutenberg support, Responsive, Fullscreen search, Multilevel menus, Support to all YITH plugins, SVG icons for HiDPI screens, Translation Ready. <a href="https://proteo.yithemes.com/about-proteo/" rel="nofollow" target="_blank">Discover more ></a> | <a href="https://proteo.yithemes.com/" rel="nofollow" target="_blank">Check our live demo ></a>
Version: 1.0.7
Version: 1.0.8
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: yith-proteo
Expand Down
4 changes: 3 additions & 1 deletion style.css

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

2 changes: 1 addition & 1 deletion style.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion template-parts/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

<?php
if ( is_singular() ) :
the_title( '<h1 class="entry-title">', '</h1>' );
yith_proteo_print_page_titles();
else :
the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
endif;
Expand Down

0 comments on commit b64f42a

Please sign in to comment.