• hello…i try to make a homepage like this

    categoryZ                date: 11/11/2015
     newpost in category
    
    categoryQ                 date: 11/11/2015
     new post in category 1
     new post in category 2
    
    categoryX                 date: 11/11/2015
     new post in category

    i want to show the latest post, but how to add the category and the date?? and if i put 2++ post in same category in the same day to be in one content like the code is possible??

Viewing 3 replies - 1 through 3 (of 3 total)
  • You should try to add multiple loops, one for each category you need.
    have a look at this article : https://www.catswhocode.com/blog/multiple-wordpress-loops

    Thread Starter vl4d

    (@vl4d)

    i have 300++ category is anime site..

    Thread Starter vl4d

    (@vl4d)

    i have this code

    <?php $query = new WP_Query( 'cat=-1' ); ?>
     <?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
    
     <div class="post">
    
     <!-- Display the Title as a link to the Post's permalink. -->
     <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    
     <!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. -->
     <small><?php the_time( 'F jS, Y' ); ?> by <?php the_author_posts_link(); ?></small>
    
      <p class="postmetadata"><?php _e( 'Posted in' ); ?> <?php the_category( ', ' ); ?></p>
     </div> <!-- closes the first div box -->
    
     <?php endwhile;
     wp_reset_postdata();
     else : ?>
     <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
     <?php endif; ?>

    its ok this i want, but the problem is this if i put 2++ post in same category in the same day to be in one content like the code

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘latest post in homepage??’ is closed to new replies.