Hola a todos.
Veréis, estoy trasteando este tema de Wordpress:
El caso es que si especifico dos grupos de posts para mostrar en la homepage, siendo el primero de la categoría Featured y especificando que sólo muestre un post y el otro grupo sea "Latest Posts" y muestre 10, el widget de suscripción a la página no se muestra.
Este widget sólo se muestra después del segundo o tercer post del primer grupo. Es decir, en este caso, tendría que especificar que el grupo de "featured" mostrara al menos 2 posts para que apareciera el widget justo a la derecha del primer post, tal como podéis ver en el home de la demo del tema.
El código que interviene en todo esto lo he encontrado en el index.php y es este:
<?php $mts_options = get_option(MTS_THEME_NAME); ?>
<?php get_header(); ?>
<div id="page">
<div id="content_box">
<?php global $post; if (!is_paged()) {
$featured_categories = array();
if (!empty($mts_options['mts_featured_categories'])) {
foreach ($mts_options['mts_featured_categories'] as $index => $section) {
$category_id = $section['mts_featured_category'];
$featured_categories[] = $category_id;
$posts_num = $section['mts_featured_category_postsnum'];
$widget_displayed = false;
if ($category_id == 'latest') {
$j = 0; // counter
if (!is_active_sidebar('widget-home'))
$widget_displayed = true; // No widget set, omit container
if (have_posts()) : while (have_posts()) : the_post();
$j++;
$featured = get_post_meta($post->ID, 'mts_featured', true);
$image_size = 'featured';
$post_class = '';
// Homepage Widget area
if ($j > 2 && !$widget_displayed && $index == 0) {
$widget_displayed = true;
?>
<article class="latestPost excerpt homepage-widget<?php echo (($j+2) % 3 == 0) ? ' first' : ''; ?><?php echo ($j % 3 == 0) ? ' last' : ''; ?>">
<?php dynamic_sidebar( 'widget-home' ); ?>
</article><!--.post excerpt-->
<?php
$j++;
}
if ($j == 1) { // ($featured && $j % 3 != 0) {
$j++; // count +1
$image_size = 'featuredbig';
$post_class = 'featuredPost';
}
?>
<article class="latestPost excerpt<?php echo (($j+2) % 3 == 0) ? ' first' : ''; ?><?php echo ($j % 3 == 0) ? ' last' : ''; ?> <?php echo $post_class; ?>" itemscope itemtype="http://schema.org/BlogPosting">
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="nofollow" id="featured-thumbnail">
<?php echo '<div class="featured-thumbnail">'; the_post_thumbnail($image_size, array('title' => '')); echo '</div>'; ?>
<?php if (function_exists('wp_review_show_total')) wp_review_show_total(true, 'latestPost-review-wrapper'); ?>
<?php if ($featured) : ?><div class="post-label"><i class="fa fa-star"></i> <span><?php _e('Featured','mythemeshop'); ?></span></div><?php endif; ?>
</a>
<header>
<h2 class="title front-view-title" itemprop="headline"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php if ( ! empty( $mts_options["mts_home_headline_meta"] ) ) { ?>
<div class="post-info">
<?php if( ! empty( $mts_options["mts_home_headline_meta_info"]['date']) ) { ?>
<span class="thetime updated"><i class="fa fa-calendar"></i> <span itemprop="datePublished"><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . __(' ago','mythemeshop'); ?></span></span>
<?php } ?>
<?php if( ! empty( $mts_options["mts_home_headline_meta_info"]['category']) ) { ?>
<span class="thecategory"><i class="fa fa-tags"></i> <?php mts_the_category(', ') ?></span>
<?php } ?>
</div>
<?php } ?>
</header>
</article><!--.post excerpt-->
<?php endwhile; endif; ?>
<!--Start Pagination-->
Como no tengo ni idea de programación no sé modificarlo para permitir que el widget se muestre también aunque sólo haya un post del primer grupo.
¿Alguien me ayuda?
Gracias de antemano