Answer the question
In order to leave comments, you need to log in
How to get data of posts displayed on category page in wordpress loop?
There is a category page category.php , how to get the data of the posts output in the standard loop?
For example, if the page displays 10 entries, how to get the id and url of each of them without making a throne of crutches?
Answer the question
In order to leave comments, you need to log in
If in a standard loop, then you can do this:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php
get_the_ID();
the_title();
the_excerpt();
echo get_the_date();
?>
<a class="br-button-el-link" href="<?php the_permalink(); ?>">Подробнее</a>
<?php endwhile; else: ?>
<p>Sorry, no posts matched your criteria.</p>
<?php endif; ?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question