• Resolved Chris

    (@dobeweb)


    The default post class is
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

    But I want to keep the class not change in the loop,
    I mean on the homepage, I want to list 10 posts, each post has different,

    <h3>latest posts</h3>
    <article id="post-<?php the_ID(); ?>" class="post-1">

    <article id="post-<?php the_ID(); ?>" class="post-2">

    <article id="post-<?php the_ID(); ?>" class="post-3">

    <article id="post-<?php the_ID(); ?>" class="post-4">

    <article id="post-<?php the_ID(); ?>" class="post-5">

    The most recent post always has the class-1, and the previous one always has the class-2

    I don’t know how to write the php, can you help me? Thank you.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to keep the post class not change in the loop?’ is closed to new replies.