articoli su due colonne

  • Creatore Discussione Creatore Discussione Fabio90
  • Data di inizio Data di inizio

Fabio90

Utente Attivo
29 Feb 2012
507
0
16
Buongiorno forum,
ho installato wordpress 3.5 e utilizzo il tema twentytwelve.
Come da titolo della discussione mi piacerebbe pubblicare gli articoli su due colonne. Ho provato a guardare diversi tutorial ma non sono riuscito ad ottenere nulla.
Qualcuno potrebbe aiutarmi postandomi il codice oppure con una buona guida?
Grazie
 
Grazie del supporto,
ho letto la guida ed ho inserito la filter function in function.php e il css in style.css del mio tema.
Non mi è chiaro deve effettuare il replace di
is_category()

with another conditional tag like

is_home()
 
Per esempio, al posto di:
PHP:
if( is_category() ) : ...
sostituisci con
PHP:
if( is_home() ) :
 
si però il codice deputato alla visualizzazione degli articoli è questo
PHP:
<?php if ( have_posts() ) : ?>

			<?php /* Start the Loop */ ?>
			<?php while ( have_posts() ) : the_post(); ?>
				<?php get_template_part( 'content', get_post_format() ); ?>
			<?php endwhile; ?>

			<?php twentytwelve_content_nav( 'nav-below' ); ?>

		<?php else : ?>

			<article id="post-0" class="post no-results not-found">

			<?php if ( current_user_can( 'edit_posts' ) ) :
				// Show a different message to a logged-in user who can add posts.
			?>
				<header class="entry-header">
					<h1 class="entry-title"><?php _e( 'No posts to display', 'twentytwelve' ); ?></h1>
				</header>

				<div class="entry-content">
					<p><?php printf( __( 'Ready to publish your first post? <a href="%s">Get started here</a>.', 'twentytwelve' ), admin_url( 'post-new.php' ) ); ?></p>
				</div><!-- .entry-content -->

			<?php else :
				// Show the default message to everyone else.
			?>
				<header class="entry-header">
					<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1>
				</header>

				<div class="entry-content">
					<p><?php _e( 'Apologies, but no results were found. Perhaps searching will help find a related post.', 'twentytwelve' ); ?></p>
					<?php get_search_form(); ?>
				</div><!-- .entry-content -->
			<?php endif; // end current_user_can() check ?>

			</article><!-- #post-0 -->

		<?php endif; // end have_posts() check ?>

e non ce alcun is_category da sostituire..
 
ok ho detto una cavolata..

questo è il codice sostituito:

PHP:
add_filter('post_class','category_two_column_classes');
 
function category_two_column_classes( $classes ) {
global $wp_query;
if( is_home() ) :
$classes[] = 'two-column-post';
if( $wp_query->current_post%2 == 0 ) $classes[] = 'two-column-post-left';
endif;
return $classes;
}

però ancora non si vede su due colonne.. Suggerimenti?
Grazie :)
 

Discussioni simili