File: /home/carrerup/.trash/techland/inc/template-parts/footer-parts.php
<?php
/**
* Custom template parts for this theme.
*
* Eventually, some of the functionality here could be replaced by core features.
*
* @package techland
*/
if ( ! function_exists( 'techland_footer' ) ) {
function techland_footer() {
if ( is_page() ) {
if ('0' != techland_mbsettings('techland_page_footer_visibility', '1')) {
do_action( 'techland_footer_widgetize_action' );
do_action( 'techland_copyright_action' );
}
} else {
do_action( 'techland_footer_widgetize_action' );
do_action( 'techland_copyright_action' );
}
}
}
/*************************************************
## WIDGETIZE FOOTER
*************************************************/
if ( ! function_exists( 'techland_footer_widgetize' ) ) {
function techland_footer_widgetize() {
if ('0' != techland_settings('footer_widgetize_visibility', '0')) {
echo '<footer id="nt-footer" class="nt-footer-sidebar footer footer--s1 footer--color-light">
<div class="footer__line footer__line--first">
<div class="container">
<div class="row">';
if (! empty(techland_settings('custom_widgets'))) {
$sidebars = techland_settings('custom_widgets');
foreach ($sidebars as $id => $column) {
$id = 'custom-footer-widget-'.($id + 1);
if (is_active_sidebar($id)) {
echo '<div class="nt-footer-widget '.$column.' '.$id.'">';
dynamic_sidebar($id);
echo '</div>';
}
}
}
echo '</div>
</div>
</div>';
techland_footer_waves();
echo '</footer>';
}
}
}
add_action( 'techland_footer_widgetize_action', 'techland_footer_widgetize', 10 );
/*
* waves effect for footer
*/
if ( ! function_exists( 'techland_footer_waves' ) ) {
function techland_footer_waves() {
if ('0' != techland_settings('footer_waves_visibility', '1') ) {
wp_enqueue_script('wavify');
$mobile_waves_display = '1' == techland_settings('footer_waves_mobile_visibility', '1') ? ' waves-mobile-on' : '';
echo '<div class="footer__waves-container">
<svg class="footer__wave js-wave'.$mobile_waves_display.'" data-wave=\'{"height": 40, "bones": 6, "amplitude": 70, "color": "rgba(78, 111, 136, 0.14)", "speed": 0.3}\' width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"><defs></defs><path d=""/></svg>
<svg class="footer__wave js-wave'.$mobile_waves_display.'" data-wave=\'{"height": 60, "bones": 5, "amplitude": 90, "color": "rgba(243, 248, 249, 0.02)", "speed": 0.35}\' width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"><defs></defs><path d=""/></svg>
</div>';
}
}
}
/*************************************************
## FOOTER COPYRIGHT
*************************************************/
if ( ! function_exists( 'techland_copyright' ) ) {
function techland_copyright() {
if ( '0' != techland_settings('footer_copyright_visibility','1') ) {
if ( 'custom' == techland_settings('footer_type') ) {
// custom footer allowed html
echo do_shortcode( techland_settings('custom_footer') );
} elseif ( 'vc-templates' == techland_settings('footer_type') ) {
if ( function_exists('techland_vc_print_saved_template') ) {
echo'<footer class="techland-footer techland-custom-'.techland_settings( 'vc_footer_templates' ).'">';
echo techland_vc_print_saved_template( techland_settings( 'vc_footer_templates' ) );
echo'</footer>';
}
} elseif ( 'templatera' == techland_settings('footer_type') ) {
if ( post_type_exists( 'templatera' ) ) {
echo'<footer class="techland-footer techland-custom-'.techland_settings( 'vc_footer_templatera' ).'">';
echo apply_filters('the_content', get_post_field('post_content', techland_settings( 'vc_footer_templatera' )));
echo'</footer>';
}
} else {
echo'<footer class="footer footer--s6 footer--color-light">
<div class="footer__line footer__line--first">
<div class="container">
<div class="row ">
<div class="col-12">';
if (! empty(techland_settings('footer_social') ) ) {
echo'<div class="footer__item">';
echo'<div class="s-btns s-btns--md s-btns--light s-btns--rounded">
<ul class="d-flex flex-row flex-wrap align-items-center justify-content-center ">';
$social = techland_settings('footer_social');
$a_target = techland_settings('footer_social_target');
for ($i=0; $i < (count($social)); $i++) {
$icon = $social[$i] ? $social[$i] : '';
$url = $social[$i+1] ? $social[$i+1] : '#';
if($icon){
echo '<li><a href="'.esc_url($url).'"';if($a_target){echo' target="'.esc_attr($a_target).'"';}echo '><i class="'.esc_attr($icon).'"></i></a></li>';
}
$i = $i+1;
}
echo'</ul>
</div>
</div>';
}
echo'<div class="footer__item text-center footer__copyright">';
if ( '' != techland_settings( 'footer_copyright' ) ) {
echo wp_kses( techland_settings( 'footer_copyright' ), techland_allowed_html() );
} else {
echo sprintf('<span class="__copy">'.esc_html__('Copyright %s ', 'techland').'<i class="fa fa-copyright"></i> <a class="__dev" href="https://ninetheme.com/contact/" target="_blank">'.esc_html__('Ninetheme', 'techland').'</a></span>', date('Y'));
}
echo'</div>
</div>
</div>
</div>
</div>
</footer>';
}
}
}
}
add_action( 'techland_copyright_action', 'techland_copyright', 10 );