updated theme GeneratePress version 3.0.2

This commit is contained in:
2020-10-20 15:16:18 +00:00
committed by Gitium
parent dcc1a6ca18
commit 1047e0b29f
129 changed files with 16624 additions and 8924 deletions

View File

@ -17,9 +17,18 @@ if ( ! function_exists( 'generate_construct_footer' ) ) {
* @since 1.3.42
*/
function generate_construct_footer() {
$inside_site_info_class = '';
if ( 'full-width' !== generate_get_option( 'footer_inner_width' ) ) {
$inside_site_info_class = ' grid-container grid-parent';
if ( generate_is_using_flexbox() ) {
$inside_site_info_class = ' grid-container';
}
}
?>
<footer class="site-info" <?php generate_do_microdata( 'footer' ); ?>>
<div class="inside-site-info <?php if ( 'full-width' !== generate_get_option( 'footer_inner_width' ) ) : ?>grid-container grid-parent<?php endif; ?>">
<footer <?php generate_do_element_classes( 'site-info', 'site-info' ); ?>>
<div class="inside-site-info<?php echo $inside_site_info_class; // phpcs:ignore ?>">
<?php
/**
* generate_before_copyright hook.
@ -43,7 +52,7 @@ if ( ! function_exists( 'generate_construct_footer' ) ) {
?>
</div>
</div>
</footer><!-- .site-info -->
</footer>
<?php
}
}
@ -75,15 +84,17 @@ if ( ! function_exists( 'generate_add_footer_info' ) ) {
* @since 0.1
*/
function generate_add_footer_info() {
$copyright = sprintf( '<span class="copyright">&copy; %1$s %2$s</span> &bull; %4$s <a href="%3$s" itemprop="url">%5$s</a>',
date( 'Y' ),
$copyright = sprintf(
'<span class="copyright">&copy; %1$s %2$s</span> &bull; %4$s <a href="%3$s"%6$s>%5$s</a>',
date( 'Y' ), // phpcs:ignore
get_bloginfo( 'name' ),
esc_url( 'https://generatepress.com' ),
_x( 'Powered by', 'GeneratePress', 'generatepress' ),
__( 'GeneratePress', 'generatepress' )
_x( 'Built with', 'GeneratePress', 'generatepress' ),
__( 'GeneratePress', 'generatepress' ),
'microdata' === generate_get_schema_type() ? ' itemprop="url"' : ''
);
echo apply_filters( 'generate_copyright', $copyright ); // WPCS: XSS ok.
echo apply_filters( 'generate_copyright', $copyright ); // phpcs:ignore
}
}
@ -97,10 +108,24 @@ if ( ! function_exists( 'generate_add_footer_info' ) ) {
* @param int $widget The ID of our widget.
*/
function generate_do_footer_widget( $widget_width, $widget ) {
$widget_width = apply_filters( "generate_footer_widget_{$widget}_width", $widget_width );
$tablet_widget_width = apply_filters( "generate_footer_widget_{$widget}_tablet_width", '50' );
$widget_classes = sprintf(
'footer-widget-%s',
absint( $widget )
);
if ( ! generate_is_using_flexbox() ) {
$widget_width = apply_filters( "generate_footer_widget_{$widget}_width", $widget_width );
$tablet_widget_width = apply_filters( "generate_footer_widget_{$widget}_tablet_width", '50' );
$widget_classes = sprintf(
'footer-widget-%1$s grid-parent grid-%2$s tablet-grid-%3$s mobile-grid-100',
absint( $widget ),
absint( $widget_width ),
absint( $tablet_widget_width )
);
}
?>
<div class="footer-widget-<?php echo absint( $widget ); ?> grid-parent grid-<?php echo absint( $widget_width ); ?> tablet-grid-<?php echo absint( $tablet_widget_width ); ?> mobile-grid-100">
<div class="<?php echo $widget_classes; // phpcs:ignore ?>">
<?php dynamic_sidebar( 'footer-' . absint( $widget ) ); ?>
</div>
<?php
@ -120,35 +145,30 @@ if ( ! function_exists( 'generate_construct_footer_widgets' ) ) {
if ( ! empty( $widgets ) && 0 !== $widgets ) :
// If no footer widgets exist, we don't need to continue.
if (
! is_active_sidebar( 'footer-1' ) &&
! is_active_sidebar( 'footer-2' ) &&
! is_active_sidebar( 'footer-3' ) &&
! is_active_sidebar( 'footer-4' ) &&
! is_active_sidebar( 'footer-5' ) )
{
if ( ! is_active_sidebar( 'footer-1' ) && ! is_active_sidebar( 'footer-2' ) && ! is_active_sidebar( 'footer-3' ) && ! is_active_sidebar( 'footer-4' ) && ! is_active_sidebar( 'footer-5' ) ) {
return;
}
// Set up the widget width.
$widget_width = '';
if ( $widgets == 1 ) {
if ( 1 === (int) $widgets ) {
$widget_width = '100';
}
if ( $widgets == 2 ) {
if ( 2 === (int) $widgets ) {
$widget_width = '50';
}
if ( $widgets == 3 ) {
if ( 3 === (int) $widgets ) {
$widget_width = '33';
}
if ( $widgets == 4 ) {
if ( 4 === (int) $widgets ) {
$widget_width = '25';
}
if ( $widgets == 5 ) {
if ( 5 === (int) $widgets ) {
$widget_width = '20';
}
?>
@ -179,7 +199,7 @@ if ( ! function_exists( 'generate_construct_footer_widgets' ) ) {
</div>
</div>
</div>
<?php
<?php
endif;
/**
@ -208,17 +228,18 @@ if ( ! function_exists( 'generate_back_to_top' ) ) {
return;
}
echo apply_filters( 'generate_back_to_top_output', sprintf( // WPCS: XSS ok.
'<a title="%1$s" rel="nofollow" href="#" class="generate-back-to-top" style="opacity:0;visibility:hidden;" data-scroll-speed="%2$s" data-start-scroll="%3$s">
<span class="screen-reader-text">%5$s</span>
%6$s
</a>',
esc_attr__( 'Scroll back to top', 'generatepress' ),
absint( apply_filters( 'generate_back_to_top_scroll_speed', 400 ) ),
absint( apply_filters( 'generate_back_to_top_start_scroll', 300 ) ),
esc_attr( apply_filters( 'generate_back_to_top_icon', 'fa-angle-up' ) ),
esc_html__( 'Scroll back to top', 'generatepress' ),
generate_get_svg_icon( 'arrow' )
) );
echo apply_filters( // phpcs:ignore
'generate_back_to_top_output',
sprintf(
'<a title="%1$s" aria-label="%1$s" rel="nofollow" href="#" class="generate-back-to-top" style="opacity:0;visibility:hidden;" data-scroll-speed="%2$s" data-start-scroll="%3$s">
%5$s
</a>',
esc_attr__( 'Scroll back to top', 'generatepress' ),
absint( apply_filters( 'generate_back_to_top_scroll_speed', 400 ) ),
absint( apply_filters( 'generate_back_to_top_start_scroll', 300 ) ),
esc_attr( apply_filters( 'generate_back_to_top_icon', 'fa-angle-up' ) ),
generate_get_svg_icon( 'arrow-up' )
)
);
}
}