Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@

// If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
?>
<p class="no-comments"><?php _e( 'Comments are closed.', 'zerif-lite' ); ?></p>

<?php endif; ?>
Expand All @@ -104,6 +104,6 @@
'comment_notes_after' => '',
)
);
?>
?>

</div><!-- #comments -->
6 changes: 3 additions & 3 deletions content-archive-download.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
*/
?>

<div class="edd_download" itemscope itemtype="http://schema.org/Product" >
<div class="edd_download" itemscope itemtype="http://schema.org/Product">
<div class="edd_download_inner">
<div class="edd_download_image">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">

<?php
if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
Expand All @@ -29,6 +29,6 @@
'download_id' => get_the_ID(),
)
);
?>
?>
</div>
</div><!-- #post-## -->
5 changes: 3 additions & 2 deletions content-frontpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

if ( ( isset( $zerif_contactus_show ) && $zerif_contactus_show != 1 ) || is_customize_preview() ) :
echo '<section class="contact-us ' . ( ( is_customize_preview() && ( ! isset( $zerif_contactus_show ) || $zerif_contactus_show == 1 ) ) ? ' zerif_hidden_if_not_customizer ' : '' ) . '" id="contact">';
?>
?>
<div class="container">
<!-- SECTION HEADER -->
<div class="section-header">
Expand Down Expand Up @@ -118,11 +118,12 @@
} elseif ( is_customize_preview() ) {
echo '<h6 class="white-text section-legend zerif_hidden_if_not_customizer"></h6>';
}
?>
?>
</div>
<!-- / END SECTION HEADER -->

<?php

if ( ! empty( $zerif_alternative_contact_form ) ) :
echo '<div class="row">';
echo do_shortcode( $zerif_alternative_contact_form );
Expand Down
8 changes: 4 additions & 4 deletions content-large.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@

if ( $categories_list && zerif_categorized_blog() ) :

?>
?>

<span class="cat-links">

<?php /* translators: Categories list */ printf( __( 'Posted in %1$s', 'zerif-lite' ), $categories_list ); ?>
<?php /* translators: Categories list */ printf( __( 'Posted in %1$s', 'zerif-lite' ), $categories_list ); ?>

</span>

Expand All @@ -133,11 +133,11 @@

if ( $tags_list ) :

?>
?>

<span class="tags-links">

<?php /* translators: Tags list */ printf( __( 'Tagged %1$s', 'zerif-lite' ), $tags_list ); ?>
<?php /* translators: Tags list */ printf( __( 'Tagged %1$s', 'zerif-lite' ), $tags_list ); ?>

</span>

Expand Down
2 changes: 1 addition & 1 deletion content-page-no-title.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
)
);

?>
?>

</div><!-- .entry-content -->

Expand Down
2 changes: 1 addition & 1 deletion content-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
)
);

?>
?>

</div><!-- .entry-content -->

Expand Down
4 changes: 2 additions & 2 deletions content-single.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
'after' => '</div>',
)
);
?>
?>

</div><!-- .entry-content -->

Expand Down Expand Up @@ -80,7 +80,7 @@
esc_url( get_permalink() )
);

?>
?>

<?php edit_post_link( __( 'Edit', 'zerif-lite' ), '<span class="edit-link">', '</span>' ); ?>

Expand Down
155 changes: 127 additions & 28 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@
* @package zerif-lite
*/



$vendor_file = trailingslashit( get_template_directory() ) . 'vendor/autoload.php';
if ( is_readable( $vendor_file ) ) {
require_once $vendor_file;
}

if ( ! defined( 'WPFORMS_SHAREASALE_ID' ) ) {
define( 'WPFORMS_SHAREASALE_ID', '848264' );
}

add_filter( 'themeisle_sdk_products', 'zerif_load_sdk' );
/**
* Loads products array.
Expand All @@ -28,7 +35,7 @@ function zerif_load_sdk( $products ) {
}


define( 'ZERIF_LITE_VERSION', '1.8.5.44' );
define( 'ZERIF_LITE_VERSION', '1.8.5.45' );



Expand Down Expand Up @@ -128,14 +135,7 @@ function zerif_setup() {
require_once get_template_directory() . '/ti-prevdem/init-prevdem.php';

/* woocommerce support */
$woocommerce_settings = apply_filters(
'zerif_woocommerce_args', array(
'single_image_width' => 1600,
'thumbnail_image_width' => 300,
'gallery_thumbnail_image_width' => 165,
)
);
add_theme_support( 'woocommerce', $woocommerce_settings );
add_theme_support( 'woocommerce' );
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
Expand Down Expand Up @@ -406,6 +406,9 @@ function zerif_setup() {
'activate_label' => esc_html__( 'Activate', 'zerif-lite' ),
'deactivate_label' => esc_html__( 'Deactivate', 'zerif-lite' ),
'content' => array(
array(
'slug' => 'wpforms-lite',
),
array(
'slug' => 'translatepress-multilingual',
),
Expand Down Expand Up @@ -521,7 +524,7 @@ function zerif_set_woo_image_sizes() {

update_option( 'zerif_update_woocommerce_customizer_controls', true );
}
add_action( 'after_setup_theme', 'zerif_set_woo_image_sizes', 10 );


/**
* Migrate logo from theme to core
Expand Down Expand Up @@ -2097,36 +2100,132 @@ function megamenu_add_theme_zerif_lite_max_menu( $themes ) {
add_filter( 'megamenu_themes', 'megamenu_add_theme_zerif_lite_max_menu' );


add_action( 'admin_notices', 'zerif_fagri_notice' );
/**
* Add a dismissible notice in the dashboard to let users know that we have a new child theme for Hestia, Fagri
* TODO: Remove this in a future release
* Function that decide if current date is before a certain date.
*
* @param string $date Date to compare.
* @return bool
*/
function zerif_fagri_notice() {
function zerif_is_before_date( $date ) {
$countdown_time = strtotime( $date );
$current_time = time();
return $current_time <= $countdown_time;
}

/**
* Add a dismissible notice in the dashboard to let users know they can migrate to Hestia
*/
function zerif_hestia_notice() {
global $current_user;
$user_id = $current_user->ID;
/* Check that the user hasn't already clicked to ignore the message */
if ( ! get_user_meta( $user_id, 'zerif_ignore_fagri_notice' ) ) {
echo '<div class="notice updated" style="position:relative;">';
printf( '<a href="%s" class="notice-dismiss" style="text-decoration:none;"></a>', '?zerif_nag_ignore_fagri=0' );
echo '<p>';
/* translators: Install Fagri link */
printf( esc_html__( 'We just launched a new free %s, you might like it.', 'zerif-lite' ), sprintf( '<a href="%1$s">%2$s</a>', admin_url( 'theme-install.php?theme=fagri' ), esc_html__( 'theme', 'zerif-lite' ) ) );
echo '</p>';
echo '</div>';

$ignored_notice = get_user_meta( $user_id, 'zerif_ignore_hestia_notice' );
if ( ! empty( $ignored_notice ) ) {
return;
}

$should_display_notice = zerif_is_before_date( '2018-11-01' );
if ( ! $should_display_notice ) {
return;
}

$message =
sprintf(
/* translators: Install Hestia link */
esc_html__( 'Check out our %s, fully compatible with your current Zerif Lite theme. You will love it!', 'zerif-lite' ),
sprintf(
'<a href="%1$s"><strong>%2$s</strong></a>',
admin_url( 'theme-install.php?theme=hestia' ),
esc_html__( 'best 2018 free theme', 'zerif-lite' )
)
);

$dismiss_button = sprintf(
'<a href="%s" class="notice-dismiss" style="text-decoration:none;"></a>',
'?zerif_nag_ignore_hestia=0'
);

printf( '<div class="notice updated" style="position:relative;">%1$s<p>%2$s</p></div>', $dismiss_button, $message );
}
add_action( 'admin_notices', 'zerif_hestia_notice' );


add_action( 'admin_init', 'zerif_nag_ignore_fagri' );
/**
* Update the zerif_ignore_hestia_notice option to true, to dismiss the notice from the dashboard
*/
function zerif_nag_ignore_hestia() {
global $current_user;
$user_id = $current_user->ID;
/* If user clicks to ignore the notice, add that to their user meta */
if ( isset( $_GET['zerif_nag_ignore_hestia'] ) && '0' == $_GET['zerif_nag_ignore_hestia'] ) {
add_user_meta( $user_id, 'zerif_ignore_hestia_notice', 'true', true );
}
}
add_action( 'admin_init', 'zerif_nag_ignore_hestia' );

/**
* Add a dismissible notice in the dashboard to let users know they can migrate to Zelle and read about Zerif renaming
*/
function zerif_neve_notice() {
global $current_user;
$user_id = $current_user->ID;

$ignored_notice = get_user_meta( $user_id, 'zerif_ignore_neve_notice' );
if ( ! empty( $ignored_notice ) ) {
return;
}

$should_display_notice = ! zerif_is_before_date( '2018-11-01' );
if ( ! $should_display_notice ) {
return;
}

$dismiss_button =
sprintf(
'<a href="%s" class="notice-dismiss" style="text-decoration:none;"></a>',
'?zerif_nag_ignore_neve=0'
);

$message1 =
sprintf(
/* translators: Install Neve link */
esc_html__( 'Zerif changes its name and will be no longer maintained. But don\'t worry about that. Check out %s, fully compatible with Zerif Lite. It\'s free and it\'s superb. You will love it!', 'zerif-lite' ),
sprintf(
'<a target="_blank" href="%1$s"><strong>%2$s</strong></a>',
esc_url( 'https://themeisle.com/themes/neve/?notice=1' ),
esc_html__( 'our newest theme', 'zerif-lite' )
)
);

$message2 =
sprintf(
/* translators: Zerif renaming article link */
esc_html__( '%s about the Zerif renaming and our next plans.', 'zerif-lite' ),
sprintf(
'<a target="_blank" href="%1$s"><strong>%2$s</strong></a>',
esc_url( 'https://themeisle.com/blog/zerif-changes-its-name-to-zelle/' ),
esc_html__( 'Read more', 'zerif-lite' )
)
);

printf(
'<div class="notice updated" style="position:relative;">%1$s<p>%2$s</p><p>%3$s</p></div>',
$dismiss_button,
$message1,
$message2
);
}
add_action( 'admin_notices', 'zerif_neve_notice' );

/**
* Update the zerif_ignore_fagri_notice option to true, to dismiss the notice from the dashboard
* Update the zerif_ignore_hestia_notice option to true, to dismiss the notice from the dashboard
*/
function zerif_nag_ignore_fagri() {
function zerif_nag_ignore_neve() {
global $current_user;
$user_id = $current_user->ID;
/* If user clicks to ignore the notice, add that to their user meta */
if ( isset( $_GET['zerif_nag_ignore_fagri'] ) && '0' == $_GET['zerif_nag_ignore_fagri'] ) {
add_user_meta( $user_id, 'zerif_ignore_fagri_notice', 'true', true );
if ( isset( $_GET['zerif_nag_ignore_neve'] ) && '0' == $_GET['zerif_nag_ignore_neve'] ) {
add_user_meta( $user_id, 'zerif_ignore_neve_notice', 'true', true );
}
}
add_action( 'admin_init', 'zerif_nag_ignore_neve' );
8 changes: 4 additions & 4 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<body <?php body_class(); ?> >

<?php
<?php
endif;

zerif_top_body_trigger();
Expand All @@ -48,7 +48,7 @@
endif;

endif;
?>
?>


<div id="mobilebgfix">
Expand Down Expand Up @@ -90,7 +90,7 @@

} else {

?>
?>
<div class="site-title-tagline-wrapper">
<h1 class="site-title">
<a href=" <?php echo esc_url( home_url( '/' ) ); ?> ">
Expand All @@ -103,7 +103,7 @@
$description = get_bloginfo( 'description', 'display' );

if ( ! empty( $description ) ) :
?>
?>

<p class="site-description">

Expand Down
6 changes: 3 additions & 3 deletions home.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
<div class="blog-header-content-wrap">
<?php if ( ! empty( $blog_header_title ) ) { ?>
<h1 class="intro-text"><?php echo esc_html( $blog_header_title ); ?></h1>
<?php
<?php
}
if ( ! empty( $blog_header_subtitle ) ) {
?>
?>
<p class="blog-header-subtitle"><?php echo esc_html( $blog_header_subtitle ); ?></p>
<?php } ?>
</div>
</div>
<?php
<?php
}
}
?>
Expand Down
Loading