How to show up posts summaries with pic in front page
-
Hello, I want some guidance in how to get posts summaries with pics from specific category, just like search results… in my front page (which is not the index.php file).
This is my frontpage: https://coachlatino.com
This is the code I have, but it displays the posts by complete:
<?php /* Template Name: Pagina de Inicio */ ?> <?php include ('header-home.php'); ?> <div id="wrapper"> <div id="content"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <!--Comienza el contenido - Columna principal--> <div class="entry"> <?php the_content('<p class="serif">Leer más... »</p>'); ?> <?php wp_link_pages(array('before' => '<p><strong>Paginas:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> <p>Coaches Destacados en el Directorio...</p> <?php $args = array( 'posts_per_page' => 3, 'category' => '40', ); $lastposts = get_posts( $args ); foreach ( $lastposts as $post ) : setup_postdata( $post ); ?> <hr> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php the_content(); ?> <?php endforeach; wp_reset_postdata(); ?> <hr> <p>Artículo de Coaching Destacado...</p> <?php $args = array( 'posts_per_page' => 1, 'category' => '39', ); $lastposts = get_posts( $args ); foreach ( $lastposts as $post ) : setup_postdata( $post ); ?> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php the_excerpt(); ?> <?php endforeach; wp_reset_postdata(); ?> </div> </div><!--/Termina el contenido - Columna principal--> <?php endwhile; endif; ?> <?php edit_post_link('Editar', '<p>', '</p>'); ?> </div> </div> <?php include(TEMPLATEPATH."/sidebar-inicio.php");?> <?php get_footer(); ?>
Thank you in advance,
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How to show up posts summaries with pic in front page’ is closed to new replies.