<?php } ?>
<?php echo '</div></div>'; } ?>
<?php if(isset($mts_options['mts_featured_slider'])) { if($mts_options['mts_featured_slider'] == '1' && $mts_options['mts_featured_slider'] != '') { ?>
<?php if(is_home() && !is_paged()) { ?>
<div class="featuredBox">
<?php $i = 1; $slider_cat = 1; if($mts_options['mts_featured_slider_cat'] != '') { $slider_cat = implode(",", $mts_options['mts_featured_slider_cat']); } $my_query = new WP_Query('cat='.$slider_cat.'&posts_per_page=4&ignore_sticky_posts=0');
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<?php if ($i == 1){ ?>
<div class="firstpost excerpt">
<?php if( function_exists('cyclone_slider') ) cyclone_slider('slide'); ?> AQUÍ HE METIDO EL SLIDER!!
</div><!--.post excerpt-->
<?php } elseif($i == 2) { ?>
<div class="secondpost excerpt">
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="nofollow" id="second-thumbnail">
<?php if ( has_post_thumbnail() ) { ?>
<?php the_post_thumbnail('mediumthumb',array('title' => '')); ?>
<?php } else { ?>
<div class="featured-thumbnail">
<img src="<?php echo get_template_directory_uri(); ?>/images/mediumthumb.png" class="attachment-featured wp-post-image" alt="<?php the_title(); ?>">
</div>
<?php } ?>
<p class="featured-excerpt">
<span class="featured-title"><?php the_title(); ?></span>
</p>
</a>
</div><!--.post excerpt-->
<?php } elseif($i == 3 || $i == 4) { ?>
<div class="thirdpost excerpt">
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="nofollow" id="third-thumbnail">
<?php if ( has_post_thumbnail() ) { ?>
<?php the_post_thumbnail('smallthumb',array('title' => '')); ?>
<?php } else { ?>
<div class="featured-thumbnail">
<img src="<?php echo get_template_directory_uri(); ?>/images/smallfthumb.png" class="attachment-featured wp-post-image" alt="<?php the_title(); ?>">
</div>
<?php } ?>
<p class="featured-excerpt">
<span class="featured-title"><?php the_title(); ?></span>
</p>
</a>
</div><!--.post excerpt-->
<?php } ?>
<?php $i++; endwhile; wp_reset_query(); ?>
</div>
<?php } ?>
<?php }} ?>
<?php
if (isset($mts_options['mts_featured_slider'])) {
if ($mts_options['mts_featured_slider'] == '1' && $mts_options['mts_featured_slider'] != '') {
?>
<?php
if (is_home() && !is_paged()) {
?>
<div class="featuredBox">
<?php
$i = 1;
$slider_cat = 1;
if ($mts_options['mts_featured_slider_cat'] != '') {
$slider_cat = implode(",", $mts_options['mts_featured_slider_cat']);
}
$my_query = new WP_Query('cat=' . $slider_cat . '&posts_per_page=4&ignore_sticky_posts=0');
while ($my_query->have_posts()):
$my_query->the_post();
?>
<?php
if ($i == 1) {
?>
<div class="firstpost excerpt">
<?php
if (function_exists('cyclone_slider'))
cyclone_slider('slide');
?> AQUÍ HE METIDO EL SLIDER!!
</div><!--.post excerpt-->
<?php
} elseif ($i == 2) {
?>
<div class="secondpost excerpt">
<a href="<?php
the_permalink();
?>" title="<?php
the_title();
?>" rel="nofollow" id="second-thumbnail">
<?php
if (has_post_thumbnail()) {
?>
<?php
the_post_thumbnail('mediumthumb', array(
'title' => ''
));
?>
<?php
} else {
?>
<div class="featured-thumbnail">
<img src="<?php
echo get_template_directory_uri();
?>/images/mediumthumb.png" class="attachment-featured wp-post-image" alt="<?php
the_title();
?>">
</div>
<?php
}
?>
<p class="featured-excerpt">
<span class="featured-title"><?php
the_title();
?></span>
</p>
</a>
</div><!--.post excerpt-->
<?php
} elseif ($i == 3 || $i == 4) {
?>
<div class="thirdpost excerpt">
<a href="<?php
the_permalink();
?>" title="<?php
the_title();
?>" rel="nofollow" id="third-thumbnail">
<?php
if (has_post_thumbnail()) {
?>
<?php
the_post_thumbnail('smallthumb', array(
'title' => ''
));
?>
<?php
} else {
?>
<div class="featured-thumbnail">
<img src="<?php
echo get_template_directory_uri();
?>/images/smallfthumb.png" class="attachment-featured wp-post-image" alt="<?php
the_title();
?>">
</div>
<?php
}
?>
<p class="featured-excerpt">
<span class="featured-title"><?php
the_title();
?></span>
</p>
</a>
</div><!--.post excerpt-->
<?php
}
?>
<?php
$i++;
endwhile;
wp_reset_query();
?>
</div>
<?php
}
?>
<?php
}
}
?>
tom_deluxe escribió:Buenos días![]()
Prueba con esto
Como verás he quitado todas las partes HTML y las he puesto en "echos" porque sino no me enteraba de nadaLo único que he hecho ha sido mirar documentación de WordPress y hacer 3 WP_Query con el parámetro "offset" que me interesaba. Es código guarro, con un trozo de código repetido
LaraRaider escribió:tom_deluxe escribió:Buenos días![]()
Prueba con esto
Como verás he quitado todas las partes HTML y las he puesto en "echos" porque sino no me enteraba de nadaLo único que he hecho ha sido mirar documentación de WordPress y hacer 3 WP_Query con el parámetro "offset" que me interesaba. Es código guarro, con un trozo de código repetido
ups..... "Parse error: syntax error, unexpected $end in /usr/home/stayinto/speakeasy-tokyo.com/blog/wp-content/themes/point/header.php on line 167" (que viene a ser la ultima linea, el cierre php) :s
Bueno, si no es igual, ya digo, esto no es tan vital, pero bueno, si sabes el fallo pues estaria bien incorporar la funcionalidad
LaraRaider escribió:Correcto, sobraba un php? justo antes de donde pegaba el codigo.
La cosa "funciona", es decir, el orden se ha invertido, pero no acaba de verse bien la cosa.... xd
mira:
Tambien te dejo el header.php, para en caso te sea de utilidad. Es el archivo con los primeros cambios hechos, asi que funciona a la perfección pero con el orden inicial.
Imagen de lo que pasa haciendo los cambios comentados: http://oi60.tinypic.invalid/ayve42.jpg
Header: http://dropcanvas.com/ciypm
<?php
if (isset($mts_options['mts_featured_slider'])) {
if ($mts_options['mts_featured_slider'] == '1' && $mts_options['mts_featured_slider'] != '') {
if (is_home() && !is_paged()) {
echo '<div class="featuredBox">';
$slider_cat = 1;
if ($mts_options['mts_featured_slider_cat'] != '') {
$slider_cat = implode(",", $mts_options['mts_featured_slider_cat']);
}
$my_query = new WP_Query('cat=' . $slider_cat . '&posts_per_page=1&ignore_sticky_posts=0&offset=2');
if ($my_query->have_posts()) {
$my_query->the_post();
echo '<div class="firstpost excerpt">';
if (function_exists('cyclone_slider'))
cyclone_slider('slide');
echo '</div><!--.post excerpt-->';
echo '<div class="secondpost excerpt">';
echo '<a href="';
the_permalink();
echo '" title="';
the_title();
echo '" rel="nofollow" id="second-thumbnail">';
if (has_post_thumbnail()) {
the_post_thumbnail('mediumthumb', array(
'title' => ''
));
} else {
echo '<div class="featured-thumbnail">';
echo '<img src="';
echo get_template_directory_uri();
echo '/images/mediumthumb.png" class="attachment-featured wp-post-image" alt="';
the_title();
echo '">';
echo '</div>';
}
echo '<p class="featured-excerpt">';
echo '<span class="featured-title">';
the_title();
echo '</span>';
echo '</p>';
echo '</a>';
echo '</div><!--.post excerpt-->';
}
wp_reset_query();
for ($i = 1; $i >= 0; --$i) {
$my_query = new WP_Query('cat=' . $slider_cat . '&posts_per_page=1&ignore_sticky_posts=0&offset='.$i);
if ($my_query->have_posts()) {
$my_query->the_post();
echo '<div class="thirdpost excerpt">';
echo '<a href="';
the_permalink();
echo '" title="';
the_title();
echo '" rel="nofollow" id="third-thumbnail">';
if (has_post_thumbnail()) {
the_post_thumbnail('smallthumb', array(
'title' => ''
));
} else {
echo '<div class="featured-thumbnail">';
echo '<img src="';
echo get_template_directory_uri();
echo '/images/smallfthumb.png" class="attachment-featured wp-post-image" alt="';
the_title();
echo '">';
echo '</div>';
}
echo '<p class="featured-excerpt">';
echo '<span class="featured-title">';
the_title();
echo '</span>';
echo '</p>';
echo '</a>';
echo '</div><!--.post excerpt-->';
}
wp_reset_query();
}
echo '</div>';
}
}
}
?>
LaraRaider escribió:Yeah!! Ahora si!!
Muchas gracias, ahora funciona todo de perlas
Si algun dia tienes alguna duda referente a html/css (mi fuerte) ya sabes donde encontrarme