Skip to content

Commit

Permalink
Merge pull request #291 from FameThemes/development
Browse files Browse the repository at this point in the history
Update to version 2.0.7
  • Loading branch information
shrimp2t authored May 4, 2018
2 parents 02489cc + 43e0902 commit f7e6b86
Show file tree
Hide file tree
Showing 12 changed files with 250 additions and 142 deletions.
2 changes: 1 addition & 1 deletion assets/sass/_external_plugins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ button {

.woocommerce-page {
.site-main .page-title {
display: none;
//display: none;
}
}

Expand Down
2 changes: 1 addition & 1 deletion assets/sass/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Theme URI: https://www.famethemes.com/themes/onepress/
Author: FameThemes
Author URI: http://www.famethemes.com
Description: OnePress is an outstanding creative and flexible WordPress one page theme well suited for business website, portfolio, digital agency, product showcase, freelancers and everyone else who appreciate good design. The theme overall is an elegant and classic one, a fine example of Bootstrap 4 WordPress theme which compatibility with latest version of WooCommerce. (Live preview : http://www.famethemes.com/preview/?theme=OnePress)
Version: 2.0.6
Version: 2.0.7
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: onepress
Expand Down
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
====================================================================
CHANGELOG
====================================================================
# 2.0.7
* NEW: Add hero button target.
* FIXED: Duplicate title on single post.
* FIXED: Duplicate title on product archive.
* FIXED: Contact form issue.


## 2.0.6
* FIXED: JS error issue.

Expand Down
11 changes: 5 additions & 6 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ function onepress_setup() {

// Recommend plugins
add_theme_support( 'recommend-plugins', array(
'contact-form-7' => array(
'name' => esc_html__( 'Contact Form 7', 'onepress' ),
'active_filename' => 'contact-form-7/wp-contact-form-7.php',
'pirate-forms' => array(
'name' => esc_html__( 'Pirate Forms', 'onepress' ),
'active_filename' => 'pirate-forms/pirate-forms.php',
),
'famethemes-demo-importer' => array(
'name' => esc_html__( 'Famethemes Demo Importer', 'onepress' ),
Expand Down Expand Up @@ -334,11 +334,10 @@ function onepress_register_required_plugins() {
*/
$plugins = array(
array(
'name' => 'Contact Form 7', // The plugin name.
'slug' => 'contact-form-7', // The plugin slug (typically the folder name).
'name' => 'Pirate Forms', // The plugin name.
'slug' => 'pirate-forms', // The plugin slug (typically the folder name).
'source' => '', // The plugin source.
'required' => false, // If false, the plugin is only 'recommended' instead of required.
'version' => '4.2', // E.g. 1.0.0. If set, the active plugin must be this version or higher.
'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch.
'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins.
'external_url' => '', // If set, overrides default API URL and points to an external URL.
Expand Down
30 changes: 28 additions & 2 deletions inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1637,6 +1637,19 @@ function onepress_customize_register( $wp_customize ) {
)
)
);
$wp_customize->add_setting( 'onepress_hcl1_btn1_target',
array(
'sanitize_callback' => 'onepress_sanitize_checkbox',
'default' => null,
)
);
$wp_customize->add_control( 'onepress_hcl1_btn1_target',
array(
'label' => __('Open Button #1 In New Window', 'onepress'),
'section' => 'onepress_hero_content_layout1',
'type' => 'checkbox',
)
);

// Button #2 Text
$wp_customize->add_setting( 'onepress_hcl1_btn2_text',
Expand Down Expand Up @@ -1666,7 +1679,7 @@ function onepress_customize_register( $wp_customize ) {
)
);

// Button #1 Style
// Button #2 Style
$wp_customize->add_setting( 'onepress_hcl1_btn2_style',
array(
'sanitize_callback' => 'onepress_sanitize_text',
Expand All @@ -1690,6 +1703,19 @@ function onepress_customize_register( $wp_customize ) {
)
)
);
$wp_customize->add_setting( 'onepress_hcl1_btn2_target',
array(
'sanitize_callback' => 'onepress_sanitize_checkbox',
'default' => null,
)
);
$wp_customize->add_control( 'onepress_hcl1_btn2_target',
array(
'label' => __('Open Button #2 In New Window', 'onepress'),
'section' => 'onepress_hero_content_layout1',
'type' => 'checkbox',
)
);


/* Layout 2 ---- */
Expand Down Expand Up @@ -3433,7 +3459,7 @@ function onepress_customize_register( $wp_customize ) {
array(
'section' => 'onepress_contact_content',
'type' => 'custom_message',
'description' => wp_kses_post( 'In order to display contact form please install <a target="_blank" href="https://vi.wordpress.org/plugins/pirate-forms/">PirateForms</a> plugin and then copy the contact form shortcode and paste it here, the shortcode will be like this <code>[pirate_forms]</code>', 'onepress' )
'description' => wp_kses_post( 'Paste your form shortcode from contact form plugin here, e.g <code>[pirate_forms]</code>', 'onepress' )
)
));

Expand Down
69 changes: 66 additions & 3 deletions inc/extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function onepress_get_media_url($media = array(), $size = 'full' )

if ( ! function_exists( 'onepress_is_wc_active' ) ) {
function onepress_is_wc_active(){
if ( function_exists( 'is_woocommerce' ) ) {
if ( class_exists( 'WooCommerce' ) || function_exists( 'is_woocommerce' ) ) {
return true;
}
return false;
Expand Down Expand Up @@ -236,8 +236,6 @@ function onepress_before_section( $section_id, $args = array() ){
'image' => ''
) );
extract( $args );
var_dump( $args );

if ( $video_url || $video_webm_url || $video_ogv_url ) {
?>
<div class="video-section"
Expand Down Expand Up @@ -329,3 +327,68 @@ function onepress_after_section( $section_id = null, $args = array() ){
add_action( 'onepress_after_section_part', 'onepress_after_section', 10, 2 );


if ( onepress_is_wc_active() ) {
/**
* Template pages
*/

if ( ! function_exists( 'woocommerce_content' ) ) {

/**
* Output WooCommerce content.
*
* This function is only used in the optional 'woocommerce.php' template.
* which people can add to their themes to add basic woocommerce support.
* without hooks or modifying core templates.
* @since 2.0.6
*/
function woocommerce_content() {

if ( is_singular( 'product' ) ) {

while ( have_posts() ) :
the_post();
wc_get_template_part( 'content', 'single-product' );
endwhile;

} else {

?>
<?php if ( apply_filters( 'woocommerce_show_page_title', true ) ) : ?>
<div class="entry-header">
<h1 class="page-title entry-title"><?php woocommerce_page_title(); ?></h1>
</div>
<?php endif; ?>

<?php do_action( 'woocommerce_archive_description' ); ?>

<?php if ( have_posts() ) : ?>

<?php do_action( 'woocommerce_before_shop_loop' ); ?>

<?php woocommerce_product_loop_start(); ?>

<?php if ( wc_get_loop_prop( 'total' ) ) : ?>
<?php while ( have_posts() ) : ?>
<?php the_post(); ?>
<?php wc_get_template_part( 'content', 'product' ); ?>
<?php endwhile; ?>
<?php endif; ?>

<?php woocommerce_product_loop_end(); ?>

<?php do_action( 'woocommerce_after_shop_loop' ); ?>

<?php else : ?>

<?php do_action( 'woocommerce_no_products_found' ); ?>

<?php
endif;

}
}
}
}


29 changes: 19 additions & 10 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
* Display header brand
* @since 1.2.1
*/


function onepress_add_retina_logo( $html ){
$custom_logo_id = get_theme_mod( 'custom_logo' );

Expand Down Expand Up @@ -1461,19 +1459,33 @@ function onepress_display_page_title(){
} else {
$page_id = get_the_ID();
}

$el = 'h1';
if ( is_singular('post') ) {
if ( ! apply_filters( 'onepress_single_show_page_header', false ) ) {
return;
}
$page_id = get_option( 'page_for_posts' );
$el = 'h2';
}


$apply_shop = false;
$is_single_product = false;

if (onepress_is_wc_active()) {
if (is_shop() || is_product_category() || is_product_tag() || is_singular('product')) {
if (is_shop() || is_product_category() || is_product_tag() || is_product() || is_singular('product') || is_product_taxonomy() ) {

$page_id = wc_get_page_id('shop');
if ( is_singular('product') ) {
if ( is_product() ) {
$el = 'h2';
$is_single_product = true;
$is_single_product = true;
$apply_shop = get_post_meta( $page_id, '_wc_apply_product', true );
}
$return = false;

remove_action('woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10);
remove_action('woocommerce_archive_description', 'woocommerce_product_archive_description', 10);
add_action( 'woocommerce_show_page_title', '__return_false', 95 );
}
}

Expand Down Expand Up @@ -1522,9 +1534,6 @@ function onepress_display_page_title(){
$excerpt = '';
}




?>
<?php if ( ! $hide_page_title ){ ?>
<div class="<?php echo esc_attr( join(' ', $classes ) ); ?>"<?php echo ( $img ) ? ' style="background-image: url(\''.esc_url( $img ).'\')" ': ''; ?>>
Expand Down Expand Up @@ -1689,4 +1698,4 @@ function onepress_footer_connect(){
</div>
<?php endif;
}
add_action( 'onepress_before_site_info', 'onepress_footer_connect', 25 );
add_action( 'onepress_before_site_info', 'onepress_footer_connect', 25 );
56 changes: 28 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"name": "customify-pro",
"version": "2.0.6",
"main": "Gruntfile.js",
"engines": {
"node": ">= 0.10.0"
},
"devDependencies": {
"autoprefixer": "^7.1.5",
"grunt": "~0.4.5",
"grunt-bumpup": "^0.6.3",
"grunt-contrib-clean": "^1.1.0",
"grunt-contrib-compress": "^1.4.3",
"grunt-contrib-concat": "^0.4.0",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "^2.2.1",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-sass": "^1.0.0",
"grunt-contrib-uglify": "*",
"grunt-contrib-watch": "^0.6.1",
"grunt-postcss": "^0.9.0",
"grunt-rtlcss": "^2.0.1",
"grunt-text-replace": "^0.4.0",
"grunt-wp-i18n": "^1.0.2"
},
"dependencies": {
"copy": "^0.3.1",
"rtlcss": "^2.2.1"
}
"name": "customify-pro",
"version": "2.0.7",
"main": "Gruntfile.js",
"engines": {
"node": ">= 0.10.0"
},
"devDependencies": {
"autoprefixer": "^7.2.6",
"grunt": "~0.4.5",
"grunt-bumpup": "^0.6.3",
"grunt-contrib-clean": "^1.1.0",
"grunt-contrib-compress": "^1.4.3",
"grunt-contrib-concat": "^0.4.0",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "^2.2.1",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-sass": "^1.0.0",
"grunt-contrib-uglify": "*",
"grunt-contrib-watch": "^0.6.1",
"grunt-postcss": "^0.9.0",
"grunt-rtlcss": "^2.0.1",
"grunt-text-replace": "^0.4.0",
"grunt-wp-i18n": "^1.0.2"
},
"dependencies": {
"copy": "^0.3.1",
"rtlcss": "^2.2.1"
}
}
2 changes: 1 addition & 1 deletion section-parts/section-contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class="<?php echo esc_attr(apply_filters('onepress_section_class', 'section-cont
<div class="contact-form col-sm-6 wow slideInUp">
<br>
<small>
<i><?php printf(esc_html__('You can install %1$s plugin and go to Customizer &rarr; Section: Contact &rarr; Section Content to show a working contact form here.', 'onepress'), '<a href="' . esc_url('https://wordpress.org/plugins/contact-form-7/', 'onepress') . '" target="_blank">Contact Form 7</a>'); ?></i>
<i><?php printf(esc_html__('You can install %1$s plugin and go to Customizer &rarr; Section: Contact &rarr; Section Content to show a working contact form here.', 'onepress'), '<a href="' . esc_url('https://wordpress.org/plugins/pirate-forms/', 'onepress') . '" target="_blank">Contact Form 7</a>'); ?></i>
</small>
</div>
<?php } ?>
Expand Down
10 changes: 8 additions & 2 deletions section-parts/section-hero.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,19 @@ class="hero-slideshow-wrapper <?php echo ( $fullscreen == 1 ) ? 'hero-slideshow-

$btn_1_style = get_theme_mod( 'onepress_hcl1_btn1_style', 'btn-theme-primary' );
$btn_2_style = get_theme_mod( 'onepress_hcl1_btn2_style', 'btn-secondary-outline' );

$btn_1_target = get_theme_mod( 'onepress_hcl1_btn1_target' );
$btn_2_target = get_theme_mod( 'onepress_hcl1_btn2_target' );
$target_1 = ( $btn_1_target == 1 ) ? 'target="_blank"' : '';
$target_2 = ( $btn_2_target == 1 ) ? 'target="_blank"' : '';

?>
<div class="container"<?php echo $hero_content_style; ?>>
<div class="hero__content hero-content-style<?php echo esc_attr( $layout ); ?>">
<?php if ($hcl1_largetext != '') echo '<h2 class="hero-large-text">' . wp_kses_post($hcl1_largetext) . '</h2>'; ?>
<?php if ($hcl1_smalltext != '') echo '<p class="hero-small-text"> ' . do_shortcode( wp_kses_post( $hcl1_smalltext ) ) . '</p>' ?>
<?php if ($hcl1_btn1_text != '' && $hcl1_btn1_link != '') echo '<a href="' . esc_url($hcl1_btn1_link) . '" class="btn '.esc_attr( $btn_1_style ).' btn-lg">' . wp_kses_post($hcl1_btn1_text) . '</a>'; ?>
<?php if ($hcl1_btn2_text != '' && $hcl1_btn2_link != '') echo '<a href="' . esc_url($hcl1_btn2_link) . '" class="btn '.esc_attr( $btn_2_style ).' btn-lg">' . wp_kses_post($hcl1_btn2_text) . '</a>'; ?>
<?php if ($hcl1_btn1_text != '' && $hcl1_btn1_link != '') echo '<a '. $target_1 .' href="' . esc_url($hcl1_btn1_link) . '" class="btn '.esc_attr( $btn_1_style ).' btn-lg">' . wp_kses_post($hcl1_btn1_text) . '</a>'; ?>
<?php if ($hcl1_btn2_text != '' && $hcl1_btn2_link != '') echo '<a '. $target_2 .' href="' . esc_url($hcl1_btn2_link) . '" class="btn '.esc_attr( $btn_2_style ).' btn-lg">' . wp_kses_post($hcl1_btn2_text) . '</a>'; ?>
</div>
</div>
<?php
Expand Down
Loading

0 comments on commit f7e6b86

Please sign in to comment.