| Current Path : /home/x/b/o/xbodynamge/namtation/wp-content/ |
| Current File : /home/x/b/o/xbodynamge/namtation/wp-content/shop-isle.tar |
template-about.php 0000666 00000013473 15115420173 0010213 0 ustar 00 <?php
/**
* The template for displaying about us page.
*
* Template Name: About us page
*
* @package WordPress
* @subpackage Shop Isle
*/
get_header(); ?>
<!-- Wrapper start -->
<div class="main">
<!-- Header section start -->
<?php
$shop_isle_header_image = get_the_post_thumbnail_url();
if ( empty( $shop_isle_header_image ) ) {
$shop_isle_header_image = get_header_image();
}
?>
<section class="page-header-module module bg-dark"
<?php
if ( ! empty( $shop_isle_header_image ) ) {
echo ' data-background="' . esc_url( $shop_isle_header_image ) . '"';
}
?>
>
<div class="container">
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<h1 class="module-title font-alt"><?php the_title(); ?></h1>
<?php
/* Header description */
$shop_isle_shop_id = get_the_ID();
if ( ! empty( $shop_isle_shop_id ) ) {
$shop_isle_page_description = get_post_meta( $shop_isle_shop_id, 'shop_isle_page_description' );
if ( ! empty( $shop_isle_page_description[0] ) ) {
echo '<div class="module-subtitle font-serif mb-0">' . wp_kses_post( $shop_isle_page_description[0] ) . '</div>';
}
}
?>
</div>
</div><!-- .row -->
</div><!-- .container -->
</section><!-- .page-header-module -->
<!-- Header section end -->
<!-- About start -->
<?php
$shop_isle_content_aboutus = '';
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
$shop_isle_content_aboutus = get_the_content();
}
}
if ( trim( $shop_isle_content_aboutus ) != '' ) {
echo '<section class="module">';
echo '<div class="container">';
echo '<div class="row">';
echo '<div class="col-sm-12">';
the_content();
echo '</div>';
echo '</div>';
echo '</div>';
echo '</section>';
}
?>
<!-- About end -->
<!-- Divider -->
<hr class="divider-w">
<!-- Divider -->
<!-- Team start -->
<section class="module">
<div class="container">
<?php
$shop_isle_our_team_title = get_theme_mod( 'shop_isle_our_team_title', __( 'Meet our team', 'themeisle-companion' ) );
$shop_isle_our_team_subtitle = get_theme_mod( 'shop_isle_our_team_subtitle',__( 'An awesome way to introduce the members of your team.', 'themeisle-companion' ) );
if ( ! empty( $shop_isle_our_team_title ) || ! empty( $shop_isle_our_team_subtitle ) ) {
echo '<div class="row">';
echo '<div class="col-sm-6 col-sm-offset-3">';
if ( ! empty( $shop_isle_our_team_title ) ) {
echo '<h2 class="module-title font-alt meet-out-team-title">' . wp_kses_post( $shop_isle_our_team_title ) . '</h2>';
}
if ( ! empty( $shop_isle_our_team_subtitle ) ) {
echo '<div class="module-subtitle font-serif meet-out-team-subtitle">';
echo wp_kses_post( $shop_isle_our_team_subtitle );
echo '</div>';
}
echo '</div>';
echo '</div><!-- .row -->';
}
/* Team members start */
echo '<div class="row">';
shop_isle_about_page_display_team_members();
echo '</div>';
/* Team members end */
?>
</div>
</section>
<!-- Team end -->
<!-- Video start -->
<?php
$shop_isle_about_page_video_background = get_theme_mod( 'shop_isle_about_page_video_background',get_template_directory_uri() . '/assets/images/background-video.jpg' );
?>
<section class="module bg-dark-60 about-page-video"
<?php
if ( ! empty( $shop_isle_about_page_video_background ) ) {
echo 'data-background="' . esc_url( $shop_isle_about_page_video_background ) . '"';}
?>
>
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="video-box">
<?php
$shop_isle_about_page_video_link = get_theme_mod( 'shop_isle_about_page_video_link' );
if ( ! empty( $shop_isle_about_page_video_link ) ) :
echo '<div class="video-box-icon">';
echo '<a href="' . esc_url( $shop_isle_about_page_video_link ) . '" class="video-pop-up"><span class="social_youtube_square"></span></a>';
echo '</div>';
endif;
if ( empty( $shop_isle_about_page_video_link ) && is_customize_preview() ) :
echo '<div class="video-box-icon shop_isle_hidden_if_not_customizer">';
echo '<a href="' . esc_url( $shop_isle_about_page_video_link ) . '" class="video-pop-up"><span class="social_youtube_square"></span></a>';
echo '</div>';
endif;
$shop_isle_about_page_video_title = get_theme_mod( 'shop_isle_about_page_video_title',__( 'Presentation', 'themeisle-companion' ) );
$shop_isle_about_page_video_subtitle = get_theme_mod( 'shop_isle_about_page_video_subtitle',__( 'What the video about our new products', 'themeisle-companion' ) );
if ( ! empty( $shop_isle_about_page_video_title ) ) :
echo '<div class="video-title font-alt">' . wp_kses_post( $shop_isle_about_page_video_title ) . '</div>';
endif;
if ( ! empty( $shop_isle_about_page_video_subtitle ) ) :
echo '<div class="video-subtitle font-alt">' . wp_kses_post( $shop_isle_about_page_video_subtitle ) . '</div>';
endif;
?>
</div>
</div>
</div><!-- .row -->
</div>
</section>
<!-- Video end -->
<!-- Features start -->
<section class="module module-advantages">
<div class="container">
<?php
$shop_isle_our_advantages_title = get_theme_mod( 'shop_isle_our_advantages_title',__( 'Our advantages', 'themeisle-companion' ) );
if ( ! empty( $shop_isle_our_advantages_title ) ) :
echo '<div class="row">';
echo '<div class="col-sm-6 col-sm-offset-3">';
echo '<h2 class="module-title font-alt our_advantages">' . wp_kses_post( $shop_isle_our_advantages_title ) . '</h2>';
echo '</div>';
echo '</div>';
endif;
shop_isle_about_page_display_advantages();
?>
</div><!-- .container -->
</section>
<!-- Features end -->
<?php get_footer(); ?>
customizer.php 0000666 00000063257 15115420173 0007501 0 ustar 00 <?php
/**
* Customizer extension for Shop Isle Companion
*/
/**
* Add Customizer Controls
*
* @param $wp_customize
*/
function shop_isle_companion_customize_register($wp_customize) {
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh';
/**
* Class ShopIsle_Companion_Aboutus_Page_Instructions
*/
class ShopIsle_Companion_Aboutus_Page_Instructions extends WP_Customize_Control {
/**
* Render about page instruction
*/
public function render_content() {
echo __( 'To customize the About us Page you need to first select the template "About us page" for the page you want to use for this purpose. Then open that page in the browser and press "Customize" in the top bar.', 'themeisle-companion' ) . '<br><br>' . __( 'Need further assistance? Check out this', 'themeisle-companion' ) . ' <a href="http://docs.themeisle.com/article/211-shopisle-customizing-the-contact-and-about-us-page" target="_blank">' . __( 'doc', 'themeisle-companion' ) . '</a>';
}
}
/*==========REMOVE BIG TITLE SECTION==========*/
$wp_customize->remove_section( 'shop_isle_big_title_section' );
/*==========SLIDER SECTION==========*/
$wp_customize->add_section( 'shop_isle_slider_section', array(
'title' => __( 'Slider section', 'themeisle-companion' ),
'panel' => 'shop_isle_front_page_sections',
'priority' => 1,
) );
if ( ! empty( $shop_isle_big_title_image ) || ! empty( $shop_isle_big_title_title ) || ! empty( $shop_isle_big_title_subtitle ) || ! empty( $shop_isle_big_title_button_label ) || ! empty( $shop_isle_big_title_button_link ) ) {
$shop_isle_companion_big_title_content;
}
/* Slider */
$wp_customize->add_setting( 'shop_isle_slider', array(
'sanitize_callback' => 'shop_isle_sanitize_repeater',
'default' => json_encode( array(
array(
'image_url' => get_template_directory_uri() . '/assets/images/slide1.jpg',
'link' => '#',
'text' => __( 'ShopIsle', 'themeisle-companion' ),
'subtext' => __( 'WooCommerce Theme', 'themeisle-companion' ),
'label' => __( 'FIND OUT MORE', 'themeisle-companion' )
),
array(
'image_url' => get_template_directory_uri() . '/assets/images/slide2.jpg',
'link' => '#',
'text' => __( 'ShopIsle', 'themeisle-companion' ),
'subtext' => __( 'Hight quality store', 'themeisle-companion' ),
'label' => __( 'FIND OUT MORE', 'themeisle-companion' )
),
array(
'image_url' => get_template_directory_uri() . '/assets/images/slide3.jpg',
'link' => '#',
'text' => __( 'ShopIsle', 'themeisle-companion' ),
'subtext' => __( 'Responsive Theme', 'themeisle-companion' ),
'label' => __( 'FIND OUT MORE', 'themeisle-companion' )
)
) ),
)
);
if ( class_exists( 'Shop_Isle_Repeater_Controler' ) ) {
$wp_customize->add_control( new Shop_Isle_Repeater_Controler( $wp_customize, 'shop_isle_slider', array(
'label' => __( 'Add new slide', 'themeisle-companion' ),
'section' => 'shop_isle_slider_section',
'active_callback' => 'is_front_page',
'priority' => 2,
'shop_isle_image_control' => true,
'shop_isle_text_control' => true,
'shop_isle_link_control' => true,
'shop_isle_subtext_control' => true,
'shop_isle_label_control' => true,
'shop_isle_icon_control' => false,
'shop_isle_box_label' => __( 'Slide', 'themeisle-companion' ),
'shop_isle_box_add_label' => __( 'Add new slide', 'themeisle-companion' ),
) ) );
}
/* Slider shortcode */
$wp_customize->add_setting( 'shop_isle_homepage_slider_shortcode', array(
'sanitize_callback' => 'shop_isle_sanitize_text',
) );
$wp_customize->add_control( 'shop_isle_homepage_slider_shortcode', array(
'label' => __( 'Slider shortcode', 'themeisle-companion' ),
'description' => __( 'You can replace the homepage slider with any plugin you like, just copy the shortcode generated and paste it here.', 'themeisle-companion' ),
'section' => 'shop_isle_slider_section',
'active_callback' => 'is_front_page',
'priority' => 10
) );
/*********************************/
/****** About us page **********/
/*********************************/
if ( class_exists( 'WP_Customize_Panel' ) ):
$wp_customize->add_panel( 'panel_team', array(
'priority' => 52,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( 'About us page', 'themeisle-companion' )
) );
$wp_customize->add_section( 'shop_isle_about_page_section', array(
'title' => __( 'Our team', 'themeisle-companion' ),
'priority' => 1,
'panel' => 'panel_team'
) );
else:
$wp_customize->add_section( 'shop_isle_about_page_section', array(
'title' => __( 'About us page - our team', 'themeisle-companion' ),
'priority' => 52
) );
endif;
/* Our team title */
$wp_customize->add_setting( 'shop_isle_our_team_title', array(
'sanitize_callback' => 'shop_isle_sanitize_text',
'default' => __( 'Meet our team', 'themeisle-companion' ),
'transport' => $selective_refresh,
) );
$wp_customize->add_control( 'shop_isle_our_team_title', array(
'label' => __( 'Title', 'themeisle-companion' ),
'section' => 'shop_isle_about_page_section',
'active_callback' => 'shop_isle_companion_is_aboutus_page',
'priority' => 1,
) );
/* Our team subtitle */
$wp_customize->add_setting( 'shop_isle_our_team_subtitle', array(
'sanitize_callback' => 'shop_isle_sanitize_text',
'default' => __( 'An awesome way to introduce the members of your team.', 'themeisle-companion' ),
'transport' => $selective_refresh,
) );
$wp_customize->add_control( 'shop_isle_our_team_subtitle', array(
'label' => __( 'Subtitle', 'themeisle-companion' ),
'section' => 'shop_isle_about_page_section',
'active_callback' => 'shop_isle_companion_is_aboutus_page',
'priority' => 2,
) );
/* Team members */
$wp_customize->add_setting( 'shop_isle_team_members', array(
'sanitize_callback' => 'shop_isle_sanitize_repeater',
'transport' => $selective_refresh,
'default' => json_encode( array(
array(
'image_url' => get_template_directory_uri() . '/assets/images/team1.jpg',
'text' => 'Eva Bean',
'subtext' => 'Developer',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit lacus, a iaculis diam.'
),
array(
'image_url' => get_template_directory_uri() . '/assets/images/team2.jpg',
'text' => 'Maria Woods',
'subtext' => 'Designer',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit lacus, a iaculis diam.'
),
array(
'image_url' => get_template_directory_uri() . '/assets/images/team3.jpg',
'text' => 'Booby Stone',
'subtext' => 'Director',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit lacus, a iaculis diam.'
),
array(
'image_url' => get_template_directory_uri() . '/assets/images/team4.jpg',
'text' => 'Anna Neaga',
'subtext' => 'Art Director',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit lacus, a iaculis diam.'
)
) ),
) );
if ( class_exists( 'Shop_Isle_Repeater_Controler' ) ) {
$wp_customize->add_control( new Shop_Isle_Repeater_Controler( $wp_customize, 'shop_isle_team_members', array(
'label' => __( 'Add new team member', 'themeisle-companion' ),
'section' => 'shop_isle_about_page_section',
'active_callback' => 'shop_isle_companion_is_aboutus_page',
'priority' => 3,
'shop_isle_image_control' => true,
'shop_isle_link_control' => false,
'shop_isle_text_control' => true,
'shop_isle_subtext_control' => true,
'shop_isle_label_control' => false,
'shop_isle_icon_control' => false,
'shop_isle_description_control' => true,
'shop_isle_box_label' => __( 'Team member', 'themeisle-companion' ),
'shop_isle_box_add_label' => __( 'Add new team member', 'themeisle-companion' )
) ) );
}
/***********************************************************************************/
/****** About us page - instructions for users when not on About us page *********/
/***********************************************************************************/
$wp_customize->add_section( 'shop_isle_aboutus_page_instructions', array(
'title' => __( 'About us page', 'themeisle-companion' ),
'priority' => 52
) );
$wp_customize->add_setting( 'shop_isle_aboutus_page_instructions', array(
'sanitize_callback' => 'shop_isle_sanitize_text'
) );
$wp_customize->add_control( new ShopIsle_Companion_Aboutus_Page_Instructions( $wp_customize, 'shop_isle_aboutus_page_instructions', array(
'section' => 'shop_isle_aboutus_page_instructions',
'active_callback' => 'shop_isle_companion_is_not_aboutus_page',
) ) );
if ( class_exists( 'WP_Customize_Panel' ) ):
$wp_customize->add_section( 'shop_isle_about_page_video_section', array(
'title' => __( 'Video', 'themeisle-companion' ),
'priority' => 2,
'panel' => 'panel_team'
) );
else:
$wp_customize->add_section( 'shop_isle_about_page_video_section', array(
'title' => __( 'About us page - video', 'themeisle-companion' ),
'priority' => 53
) );
endif;
/* Video title */
$wp_customize->add_setting( 'shop_isle_about_page_video_title', array(
'sanitize_callback' => 'shop_isle_sanitize_text',
'default' => __( 'Presentation', 'themeisle-companion' ),
'transport' => $selective_refresh,
) );
$wp_customize->add_control( 'shop_isle_about_page_video_title', array(
'label' => __( 'Title', 'themeisle-companion' ),
'section' => 'shop_isle_about_page_video_section',
'active_callback' => 'shop_isle_companion_is_aboutus_page',
'priority' => 1,
) );
/* Video subtitle */
$wp_customize->add_setting( 'shop_isle_about_page_video_subtitle', array(
'sanitize_callback' => 'shop_isle_sanitize_text',
'default' => __( 'What the video about our new products', 'themeisle-companion' ),
'transport' => $selective_refresh,
) );
$wp_customize->add_control( 'shop_isle_about_page_video_subtitle', array(
'label' => __( 'Subtitle', 'themeisle-companion' ),
'section' => 'shop_isle_about_page_video_section',
'active_callback' => 'shop_isle_companion_is_aboutus_page',
'priority' => 2,
) );
/* Video background */
$wp_customize->add_setting( 'shop_isle_about_page_video_background', array(
'default' => get_template_directory_uri() . '/assets/images/background-video.jpg',
'transport' => 'postMessage',
'sanitize_callback' => 'esc_url'
) );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'shop_isle_about_page_video_background', array(
'label' => __( 'Background', 'themeisle-companion' ),
'section' => 'shop_isle_about_page_video_section',
'active_callback' => 'shop_isle_companion_is_aboutus_page',
'priority' => 3,
) ) );
/* Video link */
$wp_customize->add_setting( 'shop_isle_about_page_video_link', array(
'sanitize_callback' => 'shop_isle_sanitize_text',
'transport' => 'postMessage'
) );
$wp_customize->add_control( 'shop_isle_about_page_video_link', array(
'label' => __( 'Video', 'themeisle-companion' ),
'section' => 'shop_isle_about_page_video_section',
'active_callback' => 'shop_isle_companion_is_aboutus_page',
'priority' => 4,
) );
if ( class_exists( 'WP_Customize_Panel' ) ):
$wp_customize->add_section( 'shop_isle_about_page_advantages_section', array(
'title' => __( 'Our advantages', 'themeisle-companion' ),
'priority' => 3,
'panel' => 'panel_team'
) );
else:
$wp_customize->add_section( 'shop_isle_about_page_advantages_section', array(
'title' => __( 'About us page - our advantages', 'themeisle-companion' ),
'priority' => 54
) );
endif;
/* Our advantages title */
$wp_customize->add_setting( 'shop_isle_our_advantages_title', array(
'sanitize_callback' => 'shop_isle_sanitize_text',
'default' => __( 'Our advantages', 'themeisle-companion' ),
'transport' => $selective_refresh,
) );
$wp_customize->add_control( 'shop_isle_our_advantages_title', array(
'label' => __( 'Title', 'themeisle-companion' ),
'section' => 'shop_isle_about_page_advantages_section',
'active_callback' => 'shop_isle_companion_is_aboutus_page',
'priority' => 1,
) );
/* Advantages */
$wp_customize->add_setting( 'shop_isle_advantages', array(
'sanitize_callback' => 'shop_isle_sanitize_repeater',
'transport' => $selective_refresh,
'default' => json_encode( array(
array(
'icon_value' => 'icon_lightbulb',
'text' => __( 'Ideas and concepts', 'themeisle-companion' ),
'subtext' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'themeisle-companion' )
),
array(
'icon_value' => 'icon_tools',
'text' => __( 'Designs & interfaces', 'themeisle-companion' ),
'subtext' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'themeisle-companion' )
),
array(
'icon_value' => 'icon_cogs',
'text' => __( 'Highly customizable', 'themeisle-companion' ),
'subtext' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'themeisle-companion' )
),
array(
'icon_value' => 'icon_like',
'text' => __( 'Easy to use', 'themeisle-companion' ),
'subtext' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'themeisle-companion' )
)
) ),
) );
if ( class_exists( 'Shop_Isle_Repeater_Controler' ) ) {
$wp_customize->add_control( new Shop_Isle_Repeater_Controler( $wp_customize, 'shop_isle_advantages', array(
'label' => __( 'Add new advantage', 'themeisle-companion' ),
'section' => 'shop_isle_about_page_advantages_section',
'active_callback' => 'shop_isle_companion_is_aboutus_page',
'priority' => 2,
'shop_isle_image_control' => false,
'shop_isle_link_control' => false,
'shop_isle_text_control' => true,
'shop_isle_subtext_control' => true,
'shop_isle_label_control' => false,
'shop_isle_icon_control' => true,
'shop_isle_description_control' => false,
'shop_isle_box_label' => __( 'Advantage', 'themeisle-companion' ),
'shop_isle_box_add_label' => __( 'Add new advantage', 'themeisle-companion' )
) ) );
}
}
$current_theme = wp_get_theme();
$shop_isle_wporg_flag = get_option( 'shop_isle_wporg_flag' );
$theme_name = $current_theme->template;
if ( isset($shop_isle_wporg_flag) && ( 'true' == $shop_isle_wporg_flag ) && ( $theme_name == 'shop-isle' ) ) {
add_action('customize_register', 'shop_isle_companion_customize_register',100);
}
/**
* Check if is about us page
*
* @return bool
*/
function shop_isle_companion_is_aboutus_page() {
return is_page_template( 'template-about.php' );
}
/**
* Check if is not about us page
*
* @return bool
*/
function shop_isle_companion_is_not_aboutus_page() {
return ! is_page_template( 'template-about.php' );
}
if ( ! function_exists( 'shop_isle_about_page_register_partials' ) ) :
/**
* Add selective refresh for About page section controls
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function shop_isle_about_page_register_partials( $wp_customize ) {
// Abort if selective refresh is not available.
if ( ! isset( $wp_customize->selective_refresh ) ) {
return;
}
/* Our team */
$wp_customize->selective_refresh->add_partial(
'shop_isle_our_team_title', array(
'selector' => '.page-template-template-about .meet-out-team-title',
'render_callback' => 'shop_isle_about_page_team_title_callback',
'container_inclusive' => false,
)
);
$wp_customize->selective_refresh->add_partial(
'shop_isle_our_team_subtitle', array(
'selector' => '.page-template-template-about .meet-out-team-subtitle',
'render_callback' => 'shop_isle_about_page_team_subtitle_callback',
'container_inclusive' => false,
)
);
$wp_customize->selective_refresh->add_partial(
'shop_isle_team_members', array(
'selector' => '.page-template-template-about .about-team-member',
'render_callback' => 'shop_isle_about_page_display_team_members',
'container_inclusive' => true,
)
);
/* Video */
$wp_customize->selective_refresh->add_partial(
'shop_isle_about_page_video_title', array(
'selector' => '.page-template-template-about .video-box .video-title',
'render_callback' => 'shop_isle_about_page_video_title_callback',
'container_inclusive' => false,
)
);
$wp_customize->selective_refresh->add_partial(
'shop_isle_about_page_video_subtitle', array(
'selector' => '.page-template-template-about .video-box .video-subtitle',
'render_callback' => 'shop_isle_about_page_video_subtitle_callback',
'container_inclusive' => false,
)
);
/* Our advantages */
$wp_customize->selective_refresh->add_partial(
'shop_isle_our_advantages_title', array(
'selector' => '.page-template-template-about .module-title.our_advantages',
'render_callback' => 'shop_isle_about_page_advantages_title_callback',
'container_inclusive' => false,
)
);
$wp_customize->selective_refresh->add_partial(
'shop_isle_advantages', array(
'selector' => '.page-template-template-about .module-advantages .multi-columns-row',
'render_callback' => 'shop_isle_about_page_display_advantages',
'container_inclusive' => true,
)
);
}
endif;
add_action( 'customize_register', 'shop_isle_about_page_register_partials' );
if ( ! function_exists( 'shop_isle_about_page_team_title_callback' ) ) :
/**
* Callback function for the about page, team section title
*
* @return string - team title value
*/
function shop_isle_about_page_team_title_callback() {
return get_theme_mod( 'shop_isle_our_team_title' );
}
endif;
if ( ! function_exists( 'shop_isle_about_page_team_subtitle_callback' ) ) :
/**
* Callback function for the about page, team section subtitle
*
* @return string - team subtitle value
*/
function shop_isle_about_page_team_subtitle_callback() {
return get_theme_mod( 'shop_isle_our_team_subtitle' );
}
endif;
if ( ! function_exists( 'shop_isle_about_page_display_team_members' ) ) :
/**
* Callback function for team members on about page
*/
function shop_isle_about_page_display_team_members() {
$shop_isle_team_members = get_theme_mod(
'shop_isle_team_members', json_encode(
array(
array(
'image_url' => get_template_directory_uri() . '/assets/images/team1.jpg',
'text' => 'Eva Bean',
'subtext' => 'Developer',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit lacus, a iaculis diam.',
),
array(
'image_url' => get_template_directory_uri() . '/assets/images/team2.jpg',
'text' => 'Maria Woods',
'subtext' => 'Designer',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit lacus, a iaculis diam.',
),
array(
'image_url' => get_template_directory_uri() . '/assets/images/team3.jpg',
'text' => 'Booby Stone',
'subtext' => 'Director',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit lacus, a iaculis diam.',
),
array(
'image_url' => get_template_directory_uri() . '/assets/images/team4.jpg',
'text' => 'Anna Neaga',
'subtext' => 'Art Director',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit lacus, a iaculis diam.',
),
)
)
);
if ( ! empty( $shop_isle_team_members ) ) {
$shop_isle_team_members_decoded = json_decode( $shop_isle_team_members );
if ( ! empty( $shop_isle_team_members_decoded ) ) {
echo '<div class="hero-slider about-team-member">';
echo '<ul class="slides">';
foreach ( $shop_isle_team_members_decoded as $shop_isle_team_member ) {
$image_url = ! empty( $shop_isle_team_member->image_url ) ? apply_filters( 'shop_isle_translate_single_string', $shop_isle_team_member->image_url, 'Team section' ) : '';
$text = ! empty( $shop_isle_team_member->text ) ? apply_filters( 'shop_isle_translate_single_string', $shop_isle_team_member->text, 'Team section' ) : '';
$description = ! empty( $shop_isle_team_member->description ) ? apply_filters( 'shop_isle_translate_single_string', $shop_isle_team_member->description, 'Team section' ) : '';
$subtext = ! empty( $shop_isle_team_member->subtext ) ? apply_filters( 'shop_isle_translate_single_string', $shop_isle_team_member->subtext, 'Team section' ) : '';
echo '<div class="col-sm-6 col-md-3 mb-sm-20 fadeInUp">';
echo '<div class="team-item">';
echo '<div class="team-image">';
if ( ! empty( $image_url ) ) {
if ( ! empty( $text ) ) {
echo '<img src="' . esc_url( $image_url ) . '" alt="' . esc_html( $text ) . '">';
} else {
echo '<img src="' . esc_url( $image_url ) . '" alt="">';
}
}
if ( ! empty( $description ) ) {
echo '<div class="team-detail">';
echo '<p class="font-serif">' . wp_kses_post( $description ) . '</p>';
echo '</div><!-- .team-detail -->';
}
echo '</div><!-- .team-image -->';
echo '<div class="team-descr font-alt">';
if ( ! empty( $text ) ) {
echo '<div class="team-name">' . wp_kses_post( $text ) . '</div>';
}
if ( ! empty( $subtext ) ) {
echo '<div class="team-role">' . wp_kses_post( $subtext ) . '</div>';
}
echo '</div><!-- .team-descr -->';
echo '</div><!-- .team-item -->';
echo '</div><!-- .col-sm-6 col-md-3 mb-sm-20 fadeInUp -->';
}
echo '</ul>';
echo '</div>';
}
} else {
if ( is_customize_preview() ) {
echo '<div class="hero-slider about-team-member"></div>';
}
}
}
endif;
if ( ! function_exists( 'shop_isle_about_page_video_title_callback' ) ) :
/**
* Callback function for video title on about page
*
* @return string - video title value
*/
function shop_isle_about_page_video_title_callback() {
return get_theme_mod( 'shop_isle_about_page_video_title' );
}
endif;
if ( ! function_exists( 'shop_isle_about_page_video_subtitle_callback' ) ) :
/**
* Callback function for video subtitle on about page
*
* @return string - video subtitle value
*/
function shop_isle_about_page_video_subtitle_callback() {
return get_theme_mod( 'shop_isle_about_page_video_subtitle' );
}
endif;
if ( ! function_exists( 'shop_isle_about_page_advantages_title_callback' ) ) :
/**
* Callback function for advantages title
*
* @return string - advantages title value
*/
function shop_isle_about_page_advantages_title_callback() {
return get_theme_mod( 'shop_isle_our_advantages_title' );
}
endif;
if ( ! function_exists( 'shop_isle_about_page_display_advantages' ) ) :
/**
* Callback function for advantages boxes on about page
*/
function shop_isle_about_page_display_advantages() {
$shop_isle_advantages = get_theme_mod(
'shop_isle_advantages', json_encode(
array(
array(
'icon_value' => 'icon_lightbulb',
'text' => __( 'Ideas and concepts', 'themeisle-companion' ),
'subtext' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'themeisle-companion' ),
),
array(
'icon_value' => 'icon_tools',
'text' => __( 'Designs & interfaces', 'themeisle-companion' ),
'subtext' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'themeisle-companion' ),
),
array(
'icon_value' => 'icon_cogs',
'text' => __( 'Highly customizable', 'themeisle-companion' ),
'subtext' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'themeisle-companion' ),
),
array(
'icon_value' => 'icon_like',
'text' => __( 'Easy to use', 'themeisle-companion' ),
'subtext' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'themeisle-companion' ),
),
)
)
);
if ( ! empty( $shop_isle_advantages ) ) :
$shop_isle_advantages_decoded = json_decode( $shop_isle_advantages );
if ( ! empty( $shop_isle_advantages_decoded ) ) :
echo '<div class="row multi-columns-row">';
foreach ( $shop_isle_advantages_decoded as $shop_isle_advantage ) :
$icon_value = ! empty( $shop_isle_advantage->icon_value ) ? apply_filters( 'shop_isle_translate_single_string', $shop_isle_advantage->icon_value, 'Advantages section' ) : '';
$text = ! empty( $shop_isle_advantage->text ) ? apply_filters( 'shop_isle_translate_single_string', $shop_isle_advantage->text, 'Advantages section' ) : '';
$subtext = ! empty( $shop_isle_advantage->subtext ) ? apply_filters( 'shop_isle_translate_single_string', $shop_isle_advantage->subtext, 'Advantages section' ) : '';
echo '<div class="col-sm-6 col-md-3 col-lg-3">';
echo '<div class="features-item">';
if ( ! empty( $icon_value ) ) :
echo '<div class="features-icon">';
echo '<span class="' . esc_attr( $icon_value ) . '"></span>';
echo '</div>';
endif;
if ( ! empty( $text ) ) :
echo '<h3 class="features-title font-alt">' . wp_kses_post( $text ) . '</h3>';
endif;
if ( ! empty( $subtext ) ) :
echo wp_kses_post( $subtext );
endif;
echo '</div>';
echo '</div>';
endforeach;
echo '</div>';
endif;
else :
if ( is_customize_preview() ) {
echo '<div class="row multi-columns-row"></div>';
}
endif;
}
endif;
class-template-loader.php 0000666 00000007100 15115420173 0011440 0 ustar 00 <?php
/**
* The template loader
*
* Used to load templates from plugin.
*/
/**
* Class Shop_Isle_Template_Loader
*/
class Shop_Isle_Template_Loader {
/**
* A reference to an instance of this class.
*/
private static $instance;
/**
* The array of templates that this plugin tracks.
*/
protected $templates;
/**
* Returns an instance of this class.
*/
public static function get_instance() {
if ( null == self::$instance ) {
self::$instance = new Shop_Isle_Template_Loader();
}
return self::$instance;
}
/**
* Initializes the plugin by setting filters and administration functions.
*/
private function __construct() {
$this->templates = array();
// Add a filter to the attributes metabox to inject template into the cache.
if ( version_compare( floatval( get_bloginfo( 'version' ) ), '4.7', '<' ) ) {
// 4.6 and older
add_filter(
'page_attributes_dropdown_pages_args',
array( $this, 'register_project_templates' )
);
} else {
// Add a filter to the wp 4.7 version attributes metabox
add_filter(
'theme_page_templates', array( $this, 'add_new_template' )
);
}
// Add a filter to the save post to inject out template into the page cache
add_filter(
'wp_insert_post_data',
array( $this, 'register_project_templates' )
);
// Add a filter to the template include to determine if the page has our
// template assigned and return it's path
add_filter(
'template_include',
array( $this, 'view_project_template')
);
// Add your templates to this array.
$this->templates = array(
'template-about.php' => 'About Us Template',
);
}
/**
* Adds our template to the page dropdown for v4.7+
*
*/
public function add_new_template( $posts_templates ) {
$posts_templates = array_merge( $posts_templates, $this->templates );
return $posts_templates;
}
/**
* Adds our template to the pages cache in order to trick WordPress
* into thinking the template file exists where it doens't really exist.
*/
public function register_project_templates( $atts ) {
// Create the key used for the themes cache
$cache_key = 'page_templates-' . md5( get_theme_root() . '/' . get_stylesheet() );
// Retrieve the cache list.
// If it doesn't exist, or it's empty prepare an array
$templates = wp_get_theme()->get_page_templates();
if ( empty( $templates ) ) {
$templates = array();
}
// New cache, therefore remove the old one
wp_cache_delete( $cache_key , 'themes');
// Now add our template to the list of templates by merging our templates
// with the existing templates array from the cache.
$templates = array_merge( $templates, $this->templates );
// Add the modified cache to allow WordPress to pick it up for listing
// available templates
wp_cache_add( $cache_key, $templates, 'themes', 1800 );
return $atts;
}
/**
* Checks if the template is assigned to the page
*/
public function view_project_template( $template ) {
// Get global post
global $post;
// Return template if post is empty
if ( ! $post ) {
return $template;
}
// Return default template if we don't have a custom one defined
if ( ! isset( $this->templates[get_post_meta(
$post->ID, '_wp_page_template', true
)] ) ) {
return $template;
}
$file = plugin_dir_path( __FILE__ ). get_post_meta(
$post->ID, '_wp_page_template', true
);
// Just to be safe, we check if the file exist first
if ( file_exists( $file ) ) {
return $file;
} else {
echo $file;
}
// Return template
return $template;
}
}
add_action( 'plugins_loaded', array( 'Shop_Isle_Template_Loader', 'get_instance' ) ); content-slider.php 0000666 00000007701 15115420173 0010217 0 ustar 00 <?php
/**
*
* ***** SLIDER *******
*
*/
$shop_isle_homepage_slider_shortcode = get_theme_mod('shop_isle_homepage_slider_shortcode');
echo '<section id="home" class="home-section home-parallax home-fade'. (empty($shop_isle_homepage_slider_shortcode) ? ' home-full-height' : ' home-slider-plugin' ) .'">';
if( !empty($shop_isle_homepage_slider_shortcode) ) {
echo do_shortcode( $shop_isle_homepage_slider_shortcode );
} else {
$shop_isle_slider = get_theme_mod( 'shop_isle_slider',json_encode( array( array( 'image_url' => get_template_directory_uri() . '/assets/images/slide1.jpg', 'link' => '#', 'text' => __( 'ShopIsle','themeisle-companion' ), 'subtext' => __( 'WooCommerce Theme','themeisle-companion' ), 'label' => __( 'FIND OUT MORE','themeisle-companion' ) ), array( 'image_url' => get_template_directory_uri() . '/assets/images/slide2.jpg', 'link' => '#', 'text' => __( 'ShopIsle','themeisle-companion' ), 'subtext' => __( 'Hight quality store','themeisle-companion' ), 'label' => __( 'FIND OUT MORE','themeisle-companion' ) ), array( 'image_url' => get_template_directory_uri() . '/assets/images/slide3.jpg', 'link' => '#', 'text' => __( 'ShopIsle','themeisle-companion' ), 'subtext' => __( 'Responsive Theme','themeisle-companion' ), 'label' => __( 'FIND OUT MORE','themeisle-companion' ) ) ) ) );
if ( ! empty( $shop_isle_slider ) ) {
$shop_isle_slider_decoded = json_decode( $shop_isle_slider );
if ( ! empty( $shop_isle_slider_decoded ) ) {
echo '<div class="hero-slider">';
echo '<ul class="slides">';
foreach ( $shop_isle_slider_decoded as $shop_isle_slide ) {
if ( ! empty( $shop_isle_slide->image_url ) ) {
if ( function_exists( 'icl_t' ) && ! empty( $shop_isle_slide->id ) ) {
$shop_isle_slider_image_url = icl_t( 'Slide ' . $shop_isle_slide->id, 'Slide image', $shop_isle_slide->image_url );
echo '<li class="bg-dark-30 bg-dark" style="background-image:url(' . esc_url( $shop_isle_slider_image_url ) . ')">';
} else {
echo '<li class="bg-dark-30 bg-dark" style="background-image:url(' . esc_url( $shop_isle_slide->image_url ) . ')">';
}
echo '<div class="hs-caption">';
echo '<div class="caption-content">';
if ( ! empty( $shop_isle_slide->text ) ) {
if ( function_exists( 'icl_t' ) && ! empty( $shop_isle_slide->id ) ) {
$shop_isle_slider_text = icl_t( 'Slide ' . $shop_isle_slide->id, 'Slide text', $shop_isle_slide->text );
echo '<div class="hs-title-size-4 font-alt mb-30">' . $shop_isle_slider_text . '</div>';
} else {
echo '<div class="hs-title-size-4 font-alt mb-30">' . $shop_isle_slide->text . '</div>';
}
}
if ( ! empty( $shop_isle_slide->subtext ) ) {
if ( function_exists( 'icl_t' ) && ! empty( $shop_isle_slide->id ) ) {
$shop_isle_slider_subtext = icl_t( 'Slide ' . $shop_isle_slide->id, 'Slide subtext', $shop_isle_slide->subtext );
echo '<div class="hs-title-size-1 font-alt mb-40">' . $shop_isle_slider_subtext . '</div>';
} else {
echo '<div class="hs-title-size-1 font-alt mb-40">' . $shop_isle_slide->subtext . '</div>';
}
}
if ( ! empty( $shop_isle_slide->link ) && ! empty( $shop_isle_slide->label ) ) {
if ( function_exists( 'icl_t' ) && ! empty( $shop_isle_slide->id ) ) {
$shop_isle_slider_link = icl_t( 'Slide ' . $shop_isle_slide->id, 'Slide button link', $shop_isle_slide->link );
$shop_isle_slider_label = icl_t( 'Slide ' . $shop_isle_slide->id, 'Slide button label', $shop_isle_slide->label );
echo '<a href="' . esc_url( $shop_isle_slider_link ) . '" class="section-scroll btn btn-border-w btn-round">' . $shop_isle_slider_label . '</a>';
} else {
echo '<a href="' . esc_url( $shop_isle_slide->link ) . '" class="section-scroll btn btn-border-w btn-round">' . $shop_isle_slide->label . '</a>';
}
}
echo '</div>';
echo '</div>';
echo '</li>';
}
}
echo '</ul>';
echo '</div>';
}
}
}
echo '</section >';
functions.php 0000666 00000001735 15115420173 0007276 0 ustar 00 <?php
/*
Plugin Name: Shop Isle Companion
Plugin URI: https://github.com/Codeinwp/shop-isle-companion
Description: Add a slider to the front page, add new sections to the about page template in Shop Isle.
Version: 1.0.8
Author: Themeisle
Author URI: http://themeisle.com
Text Domain: shop-isle-companion
Domain Path: /languages
License: GPLv2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
/**
* Filter to replace big title section with slider.
*/
add_filter ( 'shop-isle-subheader', 'shop_isle_companion_slider');
/**
* Function used for subheader filter/
* @return string
*/
function shop_isle_companion_slider() {
return plugin_dir_path( __FILE__ ) . 'content-slider.php';
}
/**
* Include customizer controls.
*/
require plugin_dir_path( __FILE__ ) . 'customizer.php';
/**
* Include template loader.
*/
require plugin_dir_path( __FILE__ ) . 'class-template-loader.php';
add_action('shop-isle-about-page-after-content', 'shop_isle_companion_about_addon');