archive.php in several columns
-
Hi All,
in the archive view, Im only showing an image. They are being show in a unique column but I want to have them in 3.
My approach is to create a div for each line (3 elements in each line). So in archive.php im doing this:
while ( have_posts() ) : the_post(); /* * Include the Post-Format-specific template for the content. * If you want to override this in a child theme, then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ echo "<div class=line>"; get_template_part( 'template-parts/content', get_post_format() ); the_post(); get_template_part( 'template-parts/content', get_post_format() ); the_post(); get_template_part( 'template-parts/content', get_post_format() ); echo "</div>"; endwhile;
And in content file I have this:
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <?php if ( 'post' === get_post_type() ) : ?> <div class="entry-meta"> <?php foundation_css_framework_posted_on(); ?> </div><!-- .entry-meta --> <?php endif; ?> </header><!-- .entry-header --> <div class="entry-content grid-x"> <?php $span = '<span class=large-4>'; $inicio = '<a href="'; $link = get_permalink(); $intermedio = '">'; $portada=types_render_field( "portada"); $fin= '</a>'; $finspan = '</span>'; $portadaenlace = $span . $inicio . $link . $intermedio . $portada . $fin . $finspan; echo $portadaenlace; ?> </div><!-- .entry-content --> <footer class="entry-footer"> <?php foundation_css_framework_entry_footer(); ?> </footer><!-- .entry-footer --> </article><!-- #post-<?php the_ID(); ?> -->
On the CSS im trying this:
.line span{ display: inline; }
But i guess this is redundant since span already should be inline.
Thanks in advance for your feedback.
Kind Regards
VíctorRThe page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘archive.php in several columns’ is closed to new replies.