Modificar Theme
-
Hola muy buenas, me gustaría que me ayudaran en una web que estoy preparando.
Quería poner tres columnas y que se mostraran todos los post ordenadamente en este apartado.http://destinodonana.com/destinations/
el código seria el siguiente:
<?php get_header(); ?>
<?php get_breadcrumbs(); ?>
<div class=»destinations-box»>
<?php $args = array(
‘type’ => ‘destinations’,
‘child_of’ => 0,
‘parent’ => »,
‘orderby’ => ‘rand’,
‘order’ => ‘RAND’,
‘hide_empty’ => 1,
‘hierarchical’ => 1,
‘exclude’ => »,
‘include’ => »,
‘number’ => »,
‘taxonomy’ => ‘destinations-category’,
‘pad_counts’ => false );$categories = get_categories( $args );
$count = 1;
foreach($categories as $cat): $count++; if($count%2 == 0){$fixed = ‘; background-attachment: fixed;’;}?>
<div <?php if(function_exists(‘z_taxonomy_image_url’)){
if(z_taxonomy_image_url($cat->term_id)){
echo ‘ style=»background: url(‘.z_taxonomy_image_url($cat->term_id).’) center top’.$fixed.'»‘;
}
}
?>>
<section class=»wrapper»>
<?php
echo ‘<h2>’.$cat->name.'</h2>’;
echo ‘<hr>’;
echo'<p>’.$cat->description.'</p>’;
$category = $cat->slug;
$args = array(
‘post_type’ => ‘destinations’,
‘posts_per_page’ => 17,
‘tax_query’ => array(
array(
‘taxonomy’ => ‘destinations-category’,
‘field’ => ‘slug’,
‘terms’ => $category
)
)
);$query = new WP_Query($args);
?>
<div class=»wrapper»>
<ul class=»slider»>
<?php if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); ?>-
<div class=»item»>
<div align=»center»>» class=»overlay»>
<?php if(get_the_post_thumbnail($post->ID,’destinations-thumba2′)){
echo get_the_post_thumbnail($post->ID,’destinations-thumba2′);
} else{
echo ‘‘;
}?>
</div>
<h3 align=»center»><?php the_title();?></h3>
<div align=»center»><?php echo ale_trim_excerpt(20); ?></div>
</div>
<?php endwhile; endif; wp_reset_query(); ?>
</div>
</section>
</div>
<?php endforeach; ?>
</div>
<?php get_footer(); ?>¿Como podría modificar el código para tenerlo mas ordenado y que se vieran todos los post y también si es posible aleatoriamente?
Saludos a todos de antemano.
-
<div class=»item»>
El debate ‘Modificar Theme’ está cerrado a nuevas respuestas.