Home › Forum › Problemi Vari con WP › Artico in home page divisi in categorie
-
AutorePost
-
-
22 Ottobre 2012 alle 14:58 #22873nineaoPartecipante
Ciao a tutti,
ho un problema di questo tipo, e penso che se si risolve, sarà utile a molti
Nel tema che sto utilizzando, automaticamente in home page mi appare l’ultimo post inserito per intero e poi sotto in una tabella gli arti post con anteprima e riassunto. ecco il sito
Quello che vorrei fare io, consiste nel creare più “blocchi” di articoli divisi per categoria. Ogni blocco ha sua volta mostr a3 post, di cui il primo con titolo, data, immagine anteprima, riassunto e gli altri due il solo titolo e data.
Riporto qui sotto quello che potrebbe essere un esempio di codice che ho trovato girando vari forum e spulciando vari temi.
L’unico mio blocco sta nel creare il codice corretto da inserire nel tema da me scelto.
Ciao a tutti
<div class="home-column"><!-- Begin lead headline and thumbnail 1 right category -->
<?php
$cat_name = esc_attr( stripslashes( get_option( 'wap8_leadthumb1_right' ) ) );
$leadthumbs = get_option('wap8_post_leadthumb1');
$cat_id = get_cat_ID($cat_name);
$cat_link = get_category_link($cat_id);
$leadthumb_two_counter = 1;
?>
<h2>" title="<?php _e('Browse all Articles in','periodic'); ?> <?php echo get_option('wap8_leadthumb1_right'); ?>"><?php echo get_option('wap8_leadthumb1_right'); ?></h2>
<div class="lead-thumb">
<?php if ( has_post_thumbnail() ) { ?>
" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('thumbnail-home', array('title' => get_the_title())); ?>
<?php } else { ?>
" rel="bookmark" title="<?php the_title_attribute(); ?>">/images/thumbnails/thumbnail-home.jpg" width="290" height="125" alt="<?php the_title_attribute(); ?>" />
<?php } ?>
<?php if ( get_option('wap8_camera_leadthumb1_right') == 'Yes' && in_category('videos') ) { ?>
<p class="video-article"><?php _e('This article contains a video.','periodic'); ?></p>
<?php } ?>
</div>
<h3>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></h3>
<p><?php the_time('j F Y'); ?> <?php _e('con','periodic'); ?> #comments"><?php comments_number(__('Nessun Commento','periodic'),__('1 Commento','periodic'),__('% Commenti','periodic')); ?></p>
<div class="sidebar-archive-thumb">
<?php if ( has_post_thumbnail() ) { ?>
" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('thumbnail-sidebar', array('title' => get_the_title())); ?>
<?php } else { ?>
" rel="bookmark" title="<?php the_title_attribute(); ?>">/images/thumbnails/thumbnail-sidebar.jpg" width="60" height="60" alt="<?php the_title_attribute(); ?>" /> <?php } ?>
<?php if ( get_option('wap8_camera_leadthumb1_right') == 'Yes' && in_category('videos') ) { ?>
<p class="video-article"><?php _e('This article contains a video.','periodic'); ?></p>
<?php } ?>
</div>
<div class="thumb-text">
<h3>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></h3>
<p><?php the_time('j F Y'); ?> <?php _e('con','periodic'); ?> #comments"><?php comments_number(__('Nessun Commento','periodic'),__('1 Commento','periodic'),__('% Commenti','periodic')); ?></p>
</div>
<?php $leadthumb_one_right = new WP_Query('cat='. $cat_id .'&showposts='. $leadthumbs .'&caller_get_posts=1');
while ( $leadthumb_one_right -> have_posts() ) : $leadthumb_one_right -> the_post();
?>
<?php if ($leadthumb_two_counter == 1 ) { ?>
<?php } else { ?>
<?php } ?>
<?php $leadthumb_two_counter++; endwhile; ?>
</div><!-- End lead headline and thumbnail 1 right category -->
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.