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
13 changes: 8 additions & 5 deletions content-frontpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
}

/* CONTACT US */
$zerif_contactus_show = get_theme_mod( 'zerif_contactus_show' );
$zerif_contactus_show = get_theme_mod( 'zerif_contactus_show' );
$zerif_alternative_contact_form = get_theme_mod( 'zerif_contactus_shortcode' );

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">';
Expand Down Expand Up @@ -122,12 +123,14 @@
<!-- / END SECTION HEADER -->

<?php
if ( defined( 'PIRATE_FORMS_VERSION' ) && shortcode_exists( 'pirate_forms' ) ) :

if ( ! empty( $zerif_alternative_contact_form ) ) :
echo '<div class="row">';
echo do_shortcode( '[pirate_forms]' );
echo do_shortcode( $zerif_alternative_contact_form );
echo '</div>';
elseif ( defined( 'PIRATE_FORMS_VERSION' ) && shortcode_exists( 'pirate_forms' ) ) :
echo '<div class="row">';
echo do_shortcode( '[pirate_forms]' );
echo '</div>';

endif;
?>

Expand Down
38 changes: 37 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,14 @@ function zerif_setup() {
require_once get_template_directory() . '/ti-prevdem/init-prevdem.php';

/* woocommerce support */
add_theme_support( 'woocommerce' );
$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( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
Expand Down Expand Up @@ -469,6 +476,35 @@ function zerif_setup() {

add_action( 'after_setup_theme', 'zerif_setup' );

/**
* Add compatibility with WooCommerce Product Images customizer controls.
*/
function zerif_set_woo_image_sizes() {

$execute = get_option( 'zerif_update_woocommerce_customizer_controls', false );
if ( $execute !== false ) {
return;
}

update_option( 'woocommerce_thumbnail_cropping', 'custom' );
update_option( 'woocommerce_thumbnail_cropping_custom_width', '3' );
update_option( 'woocommerce_thumbnail_cropping_custom_height', '2' );

if ( class_exists( 'WC_Regenerate_Images' ) ) {
$regenerate_obj = new WC_Regenerate_Images();
$regenerate_obj::init();
if ( method_exists( $regenerate_obj, 'maybe_regenerate_images' ) ) {
$regenerate_obj::maybe_regenerate_images();
} elseif ( method_exists( $regenerate_obj, 'maybe_regenerate_images_option_update' ) ) {
// Force woocommerce 3.3.1 to regenerate images
$regenerate_obj::maybe_regenerate_images_option_update( 1, 2, '' );
}
}

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
15 changes: 15 additions & 0 deletions inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2271,6 +2271,21 @@ function zerif_blog_header_title_subtitle_callback() {
)
);

/* zerif_contact_shortcode */
$wp_customize->add_setting(
'zerif_contactus_shortcode', array(
'sanitize_callback' => 'zerif_sanitize_input',
)
);
$wp_customize->add_control(
'zerif_contactus_shortcode', array(
'label' => __( 'Contact Form Shortcode', 'zerif-lite' ),
'description' => __( 'Or add the shortcode of your choice here.', 'zerif-lite' ),
'section' => 'zerif_contactus_section',
'priority' => 2,
)
);

/* Use the contact options from the theme, only if Pirate Forms is not installed */
if ( ! defined( 'PIRATE_FORMS_VERSION' ) ) {
/* Contactus email */
Expand Down
78 changes: 74 additions & 4 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,72 @@ textarea:focus {
border: 1px solid rgba(0, 0, 0, 0.3);
outline: 0;
}
/* Support for Contact Form 7 plugin */
.contact-us form.wpcf7-form label, .contact-us form.wpcf7-form .wpcf7-list-item-label {
color: #fff;
}

form.wpcf7-form p label {
display: block;
text-align: left;
}

form.wpcf7-form p label > span {
margin-top: 5px;
}

span.wpcf7-form-control-wrap {
display: block;
}

.contact-us .wpcf7-list-item{
margin: 0;
width: 100%;
text-align: left;
}

span.wpcf7-form-control-wrap input:not([type="checkbox"]):not([type="radio"]),
span.wpcf7-form-control-wrap select{
display: block;
width: 100%;
border-radius: 4px;
padding: 9px 9px 9px 15px;
}

span.wpcf7-form-control-wrap input[type="file"]{
padding: 0;
}

span.wpcf7-form-control-wrap input::placeholder {
color: #A0A0A0;
}

span.wpcf7-form-control-wrap textarea {
color: #A0A0A0;
padding: 9px 9px 9px 15px;
}

.contact-us form.wpcf7-form input[type="submit"] {
float: right;
margin-right: 0;
}
.pirate-forms-fields-container .form_field_wrap{
text-align: left;
}

.pirate-forms-file-upload-hidden.form-control {
height: auto;
}

@media screen and (max-width: 767px) {
.pirate-forms-fields-container .form_field_wrap {
clear: both;
}
}

.form-control {
height: auto;
}

/*---------------------------------------
** 5.0 Navigation -----
Expand Down Expand Up @@ -2475,12 +2540,18 @@ section#contact .pirate_forms .contact_checkbox_wrap p {
}
.pirate-forms-maps-custom {
float: left;
text-align: left;
}
.contact-us .pirate-forms-maps-custom,
.contact-us .contact_checkbox_wrap {
color: #ffffff;
}

.contact-us .pirate_forms .contact_checkbox_wrap,
.contact-us .pirateform_wrap_classes_spam_wrap {
text-align: left;
}

.zerif_hidden_if_not_customizer {
display: none !important;
}
Expand Down Expand Up @@ -6670,10 +6741,6 @@ body.custom-background {
.pirate-forms-g-recaptcha > div {
display: inline-block;
}
.pirate_forms .pirate-forms-submit-button {
display: inline-block;
text-align: center;
}
.contact_submit_wrap {
text-align: center;
}
Expand Down Expand Up @@ -6729,6 +6796,9 @@ body.custom-background {
}
}
@media (max-width: 480px) {
.contact-us form.wpcf7-form input[type="submit"] {
width: 100%;
}
/* HOME */
.intro {
margin-top: 60%;
Expand Down
11 changes: 7 additions & 4 deletions template-frontpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
}

/* CONTACT US */
$zerif_contactus_show = get_theme_mod( 'zerif_contactus_show' );
$zerif_contactus_show = get_theme_mod( 'zerif_contactus_show' );
$zerif_alternative_contact_form = get_theme_mod( 'zerif_contactus_shortcode' );

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">';
Expand Down Expand Up @@ -124,12 +125,14 @@
<!-- / END SECTION HEADER -->

<?php
if ( defined( 'PIRATE_FORMS_VERSION' ) && shortcode_exists( 'pirate_forms' ) ) :

if ( ! empty( $zerif_alternative_contact_form ) ) :
echo '<div class="row">';
echo do_shortcode( $zerif_alternative_contact_form );
echo '</div>';
elseif ( defined( 'PIRATE_FORMS_VERSION' ) && shortcode_exists( 'pirate_forms' ) ) :
echo '<div class="row">';
echo do_shortcode( '[pirate_forms]' );
echo '</div>';

endif;
?>

Expand Down