<div id="gk-mainbody">
<?php while ( have_posts() ) : the_post(); ?>
<?php gk_content_nav(); ?>
<?php get_template_part( 'content', 'single' );
// récupère titre de la page qui est la même que celle de ma catégorie
$cat=get_the_title();
//récupère id de la catégorie
$id=get_cat_id($cat);
?>
<!-- requête affichants les posts de la catégorie dont id est $id -->
<?php query_posts("cat=$id");
while ( have_posts() ) : the_post();
echo '<li><a href="'.get_permalink().'">'
.get_the_post_thumbnail(
$post->ID,
array(150,150),
array('class' => 'post_thumbnail')
).'</a></li>';
endwhile;
// Reset Query
wp_reset_query();
?>
<?php endwhile; ?>
<div id="gk-mainbody">Bien sûr il faudra voir le css
<?php while ( have_posts() ) : the_post(); ?>
<?php gk_content_nav(); ?>
<?php get_template_part( 'content', 'single' );
// récupère titre de la page qui est la même que celle de ma catégorie
$cat=get_the_title();
//récupère id de la catégorie
$id=get_cat_id($cat);
?>
<!-- requête affichants les posts de la catégorie dont id est $id -->
<?php query_posts("cat=$id");?>
<div classs="img_articles_categ">
<?php while ( have_posts() ) : the_post();
$feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
echo '<a href="'.get_permalink().'"><img src="'
.$feat_image.'" alt="img_post"</a>';
endwhile;
// Reset Query
wp_reset_query();
?></div>
<?php endwhile; ?>
</div>
<?php $args = array( 'post_type' => 'attachment', 'orderby' => 'menu_order', 'order' => 'ASC', 'post_mime_type' => 'image' ,'post_status' => null, 'numberposts' => null, 'post_parent' => $post->ID ); $attachments = get_posts($args); if ($attachments) { foreach ( $attachments as $attachment ) { $alt = get_post_meta($attachment->ID,'_wp_attachment_image_alt', true); $image_title = $attachment->post_title; $caption = $attachment->post_excerpt; $description = $image->post_content; ?> <a href="<?php echo wp_get_attachment_url( $attachment->ID); ?>" rel="lightbox" title="<?php echo $image_title; ?>"> <img src="<?php echo get_bloginfo('template_directory');?> /timthumb.php?h=75&w=75&zc=1&src=<?php echo wp_get_attachment_url( $attachment->ID , false ); ?>" alt="<?php echo $alt; ?>" width="75" height="75" border="0" /></a> <?php } } ?>
<?php
/*
* Template Name: Model_category
*/
global $wp_query, $post;
$fullwidth = true;
gk_load('header');
gk_load('before', null, array('sidebar' => false));
?>
<div id="gk-mainbody">
<?php while ( have_posts() ) : the_post(); ?>
<?php gk_content_nav(); ?>
<?php get_template_part( 'content', 'single' ); ?>
<?php
$args = array( 'post_type' => 'attachment', 'orderby' => 'menu_order', 'order' => 'ASC', 'post_mime_type' => 'image' ,'post_status' => null, 'numberposts' => null, 'post_parent' => $post->ID );
$attachments = get_posts($args);
if ($attachments) {
foreach ( $attachments as $attachment ) {
$alt = get_post_meta($attachment->ID,'_wp_attachment_image_alt', true);
$image_title = $attachment->post_title;
$caption = $attachment->post_excerpt;
$description = $image->post_content;
?>
<a href="<?php echo wp_get_attachment_url( $attachment->ID); ?>"
rel="lightbox" title="<?php echo $image_title; ?>">
<img src="<?php echo get_bloginfo('template_directory');?>
/timthumb.php?h=75&w=75&zc=1&src=<?php echo wp_get_attachment_url( $attachment->ID , false ); ?>"
alt="<?php echo $alt; ?>" width="75" height="75" border="0" /></a>
<?php } } ?>
<?php endwhile; ?>
</div>
<?php
gk_load('after', null, array('sidebar' => false));
gk_load('footer');
// EOF