[ad_1]
Hello!
I have a problem with posts that load when a button is clicked. They are missing a title/link. Headlines in the first posts are displayed normally. What can be done about it?
This is how I post
<?php
$args = ([
'showposts'=>8,
'offset'=>0,
'category_name'=> cat,
'meta_key' => 'sort',
'orderby' => 'meta_value',
'order' => 'ASC'
]);
$last_posts = get_posts($args);
foreach( $last_posts as $pst ){?>
<div class="recommend__item">
<picture>
<source srcset="https://projectdmc.org/https://projectdmc.org/<?php echo get_the_post_thumbnail_url( $pst->ID ); ?>" type="image/webp">
<img src="https://projectdmc.org/support/topic/post-titles-are-not-displayed-2/<?php echo get_the_post_thumbnail_url(); ?>" alt="Рекоммендуем">
</picture>
<div class="recommend__info">
<p class="recommend__item-name"><?php echo $pst->post_title ?></p>
<a href="<?php echo get_permalink( $pst->ID ); ?>" class="recommend__item-link">подробнее</a>
</div>
<?php if(has_tag(31, $pst->ID)): ?>
<div class="availability"><span>В наличии</span></div>
<?php endif;?>
<?php if(has_tag(32, $pst->ID)): ?>
<div class="no_availability"><span>Нет в наличии</span></div>
<?php endif;?>
<?php if(has_tag(33, $pst->ID)): ?>
<div class="on_order"><span>Под заказ</span></div>
<?php endif;?>
</div>
<?php } ?>
</div>
<?php echo do_shortcode('[ajax_load_more container_type="div" post_type="post" posts_per_page="8" images_loaded="true" placeholder="true"]'); ?>The page I need help with: [log in to see the link]
