E
E
Eugene2020-02-29 18:44:30
WordPress
Eugene, 2020-02-29 18:44:30

How to display a category in a specific block in wordpress?

Hello. The site implemented the display of records with a certain category in a separate block on the main page.
Category - "top" was displayed in a container at the top of the page. After updating to the latest wp, the output stopped working.
Here is the code I found for this category.
home-page.php file


<?php $data = PostService::getPostsForTag('top', 3, ['excerpt_length' => 120]); ?>
<?php foreach ($data as $post) : ?>
<?php get_template_part('template-parts/bigtile', 'post'); ?>
<?php endforeach; ?>


How can I solve the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Morev, 2020-02-29
@SeaInside

The PostService class that receives posts from you is something not related to WordPress, something self-made.
Find where this class is declared - and there in the getPostsForTag method you can already see what is broken.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question