Skip to main content
deleted 54 characters in body
Source Link
тнє Sufi
  • 1.7k
  • 3
  • 19
  • 28

Here is a code snippet for the second loop:

<?php wp_reset_postdata();
$args = array (
    'cat' => array ( 1,2,3 ), //replace with your category ids
    'posts_per_page' => 5 //change it as needed
   );
$category_posts = new WP_Query ( $args );

if( $category_posts->have_posts() ):
    while( $category_posts->have_posts() ):
        $category_posts->the_post(); ?>
        <a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
        <p><?php the_excerpt(); ?></p>
    <?php endwhile; 
 endif;
 wp_reset_postdata(); ?>

Use your css selectors to style it perfectly. Hope this helps.

Here is a code snippet for the second loop:

<?php wp_reset_postdata();
$args = array (
    'cat' => array ( 1,2,3 ), //replace with your category ids
    'posts_per_page' => 5 //change it as needed
   );
$category_posts = new WP_Query ( $args );

if( $category_posts->have_posts() ):
    while( $category_posts->have_posts() ):
        $category_posts->the_post(); ?>
        <a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
        <p><?php the_excerpt(); ?></p>
    <?php endwhile; 
 endif;
 wp_reset_postdata(); ?>

Use your css selectors to style it perfectly. Hope this helps.

Here is a code snippet for the second loop:

<?php $args = array (
    'cat' => array ( 1,2,3 ), //replace with your category ids
    'posts_per_page' => 5 //change it as needed
   );
$category_posts = new WP_Query ( $args );

if( $category_posts->have_posts() ):
    while( $category_posts->have_posts() ):
        $category_posts->the_post(); ?>
        <a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
        <p><?php the_excerpt(); ?></p>
    <?php endwhile; 
endif; ?>

Use your css selectors to style it perfectly. Hope this helps.

Source Link
тнє Sufi
  • 1.7k
  • 3
  • 19
  • 28

Here is a code snippet for the second loop:

<?php wp_reset_postdata();
$args = array (
    'cat' => array ( 1,2,3 ), //replace with your category ids
    'posts_per_page' => 5 //change it as needed
   );
$category_posts = new WP_Query ( $args );

if( $category_posts->have_posts() ):
    while( $category_posts->have_posts() ):
        $category_posts->the_post(); ?>
        <a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
        <p><?php the_excerpt(); ?></p>
    <?php endwhile; 
 endif;
 wp_reset_postdata(); ?>

Use your css selectors to style it perfectly. Hope this helps.