• This is the category page on my website, specifically for articles related to Vatican City. On this page, you can see a list of all the articles I’ve chosen for this category.
    I want visitors to get a glimpse of each article without accessing the full content right away. Instead, I plan to show a part of each article and include a “READ MORE” button for those interested in the full details.
    How can I set this up?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Edit Vatican City category and use the Excerpt box and replace the_content() with the_excerpt() within the loop.

    <?php while (have_posts()) : the_post(); ?>
    <div class="post">
          <h2><?php the_title(); ?></h2>
          <div class="excerpt"><?php the_excerpt(); ?></div>
          <a href="<?php the_permalink(); ?>" class="read-more">READ MORE</a>
       </div>
    <?php endwhile; ?>
    
    

    Add custom CSS in your theme stylesheet to style the read more button.

    .read-more {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 10px;
    background-color: #3498db;
    color: #fff;
    text-decoration: none;
    }

    Your category page will show post excerpts with a READ MORE button.

    Thread Starter brianjmoore

    (@brianjmoore)

    where must i add this code?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Category Page in WordPress’ is closed to new replies.