| Server IP : 89.248.107.232 / Your IP : 216.73.217.70 Web Server : Apache System : Linux host2.kasilh.com 5.14.0-687.36.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 7 05:40:49 EDT 2026 x86_64 User : seg ( 10005) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/seg-sa.es/atjconsultores.com/wp-content/themes/StoreFront/ |
Upload File : |
<?php
/*
Template Name: Frontpage
*/
global $gk_tpl, $post;
//remove automatic paragraph in wordpress editor for the frontpage based on posts
remove_filter('the_content', 'wpautop');
gk_load('header');
// get the frontpage template
$front = get_page_by_path('frontpage-source');
//create arguments for custom main loop
$args_global = array(
'post_type' => 'page',
'post_parent' => $front->ID,
'order' => 'ASC',
'posts_per_page' => -1
);
$loop_global = new WP_Query( $args_global );
// set counters
$counter = 0;
$counter_slides = 0;
// settings connected with the slider
$autoanim = 'off';
if (get_option($gk_tpl->name . '_slider_autoanimation', 'Y') == 'Y') {
$autoanim = 'on';
}
$speed = get_option($gk_tpl->name . '_slider_speed', '200');
$interval = get_option($gk_tpl->name . '_slider_interval', '5000');
// settings connected with the tabs
$tab_autoanim = 'disabled';
if ($tab_autoanim = get_option($gk_tpl->name . '_tab_autoanimation', 'N') == 'Y') {
$tab_autoanim = 'enabled';
}
$tab_interval = $interval = get_option($gk_tpl->name . '_tab_interval', '5000');
?>
<div id="gk-header-mod">
<?php if ( !function_exists('register_sidebar') || !dynamic_sidebar('Slider portada') ) : ?>;<?php endif; ?>
</div>
<?php if ( have_posts() ) : ?>
<?php while ( $loop_global->have_posts() ) : $loop_global->the_post(); ?>
<?php
$args = array(
'post_parent' => $post->ID,
'post_type' => 'page',
'posts_per_page' => 1,
'post_status' => 'publish'
);
$children = get_children($args); ?>
<?php if(!empty($children) && $counter == 0) : ?>
<div id="gk-header-mod">
<div id="gk-is-storefront" class="gk-is-wrapper-gk-storefront" data-speed="<?php echo $speed; ?>" data-interval="<?php echo $interval; ?>" data-autoanim="<?php echo $autoanim; ?>">
<div class="gk-is-preloader"><span></span></div>
<div class="gk-is-image-wrapper">
<?php
$query = new WP_Query( array ( 'post_type' => 'page', 'post_parent' => $post->ID) );
while ( $query->have_posts() ) : $query->the_post();
?>
<figure data-zindex="<?php echo $counter; ?>" data-url="<?php echo wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) ); ?>" data-link="<?php echo get_post_meta( $post->ID, 'slide_url', true ); ?>" data-title="<?php the_title(); ?>">
<figcaption>
<?php the_content(); ?>
</figcaption>
</figure>
<?php $counter_slides++; ?>
<?php endwhile; ?>
<?php if (get_option($gk_tpl->name . '_slider_navigation', 'Y') == 'Y') : ?>
<ul class="gk-is-pagination">
<?php
for($j = 0; $j < $counter_slides; $j++) {
echo '<li'.($j == 0 ? ' class="active"' : '').'>'.($j+1).'</li>';
}
?>
</ul>
<?php endif; ?>
</div>
</div>
</div>
<?php elseif(!empty($children) && $counter > 0) : ?>
<?php
$args_tabs = array(
'post_parent' => $post->ID, // the ID from your loop
'post_type' => 'page',
'posts_per_page' => -1,
'post_status' => 'publish',
'order' => 'ASC'
);
?>
<div class="gk-page">
<div class="gk-bottom">
<h3 class="box-title bigtitle"><small><?php echo get_the_title(); ?></small></h3>
<div id="gk-tabs">
<div class="gk-tabs" data-event="click" data-autoanim="<?php echo $tab_autoanim; ?>" data-speed="50" data-interval="<?php echo $tab_interval; ?>">
<div class="gk-tabs-wrap">
<?php
$tabs = array();
$tabs_content = array();
$posts = get_posts($args_tabs);
foreach ($posts as $post) {
array_push($tabs, get_the_title());
array_push($tabs_content, $post->post_content);
}
?>
<ol class="gk-tabs-nav">
<?php
for($i = 0; $i < count($tabs); $i++) {
echo '<li'.(($i == 0) ? ' class="active"' : '').'>' .$tabs[$i]. '</li>';
}
?>
</ol>
<div class="gk-tabs-container">
<?php
for($j = 0; $j < count($tabs_content); $j++) {
echo '<div class="gk-tabs-item'.(($j == 0) ? ' active' : '').'">' . do_shortcode($tabs_content[$j]). '</div>';
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php else : ?>
<div class="gk-bottom portadacont">
<?php if(has_post_thumbnail()) : ?>
<div class="box parallax" style="background-image: url('<?php echo wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) ); ?>');">
<h3 class="box-title gk-page"><?php the_title(); ?></h3>
<div class="gk-page">
<?php the_content(); ?>
</div>
</div>
<?php else : ?>
<div class="box">
<div class="gk-page">
<?php the_content(); ?>
</div>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php $counter++; ?>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
<?php /* ------------------------ NSP CUSTOM -------------------------- */ ?>
<section class="gk-bottom">
<div class="box">
<h3 class="box-title cmbt">Nuestras <span style="font-weight:600;">Novedades</span> </h3>
<p class="intronsp">No te pierdas todas nuestras noticias y novedades.</p>
<article class="gk-page nspcm" style="margin: auto;">
<?php $temp_query = $wp_query; ?>
<?php query_posts('showposts=1'); ?>
<?php
$ultimas = new WP_Query();
$ultimas->query('showposts=3');
while ($ultimas->have_posts()) : $ultimas->the_post();
?>
<div class="gk-nsp-art gk-nsp-cols-3">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="gk-responsive gk-image-link gk-image-wrapper-overlay-wrap"><?php
if (has_post_thumbnail()) {
the_post_thumbnail();
}
?>
<span class="gk-image-wrapper-overlay"><span><span></span></span></span>
</a>
<div class="cajanspcm">
<h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php
$permalink = get_permalink($post->ID);
$excerpt = get_the_title();
$conta=strlen($excerpt);
$excerpt = strip_tags($excerpt);
$excerpt = substr($excerpt, 0, 61);
//$excerpt = substr($excerpt, 0, strripos($excerpt, " "));
echo $excerpt;
if($conta>61){echo '...';}
?>
</a></h3>
<p class="fecha"><?php echo get_the_date(); ?></p>
<p class="contenido">
<?php
$permalink = get_permalink($post->ID);
$excerpt = get_the_content();
$excerpt = strip_tags($excerpt);
$excerpt = substr($excerpt, 0, 100);
$excerpt = substr($excerpt, 0, strripos($excerpt, " "));
echo $excerpt.'...';
?></p>
<p class="seguirleyendo"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">SEGUIR LEYENDO...</a></p>
</div>
</div>
<?php
endwhile;
wp_reset_postdata();
?>
</article>
</div>
</section>
<section class="box backartdes">
<article class="cuerpo">
<?php if ( !function_exists('register_sidebar') || !dynamic_sidebar('Mainbody Bottom Portada') ) : ?><?php endif; ?>
</article>
</section>
<?php /* ------------------------ NSP CUSTOM -------------------------- */ ?>
<?php if(gk_is_active_sidebar('bottom')) : ?>
<div id="gk-bottom">
<?php if ( !function_exists('register_sidebar') || !dynamic_sidebar('Logo pie') ) : ?>;<?php endif; ?>
<div class="widget-area gk-page">
<?php gk_dynamic_sidebar('bottom'); ?>
</div>
</div>
<?php endif; ?>
<?php else : ?>
<section id="gk-mainbody">
<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', GKTPLNAME ); ?></h1>
</header>
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', GKTPLNAME ); ?></p>
<?php get_search_form(); ?>
</div>
</article>
</section>
<?php endif; ?>
<?php
gk_load('footer');
// EOF