I
I
it_pear_yurec2018-07-21 14:09:28
WordPress
it_pear_yurec, 2018-07-21 14:09:28

the_excerpt() function does not work, what should I do?

the_excerpt() function does not work, what should I do?

<?php if (have_posts()) { while (have_posts()) { the_post(); ?>
              <div class="contentItem">
                <a href="<?php the_permalink(); ?>" class="news__link"><?php the_title(); ?></a>
                <p class="news__date">Опубликовано: <?php the_date(); ?></p>
                <?php the_post_thumbnail( 'thambnail' ) ?>
                <div class="news__text">
                  <?php the_excerpt(); ?>
                </div>
              </div>
              <?php } // конец while ?>
                <?php the_posts_pagination(); ?>
              <?php }  // конец if  ?>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
multiscripter, 2018-07-22
@it_pear_yurec

Maybe there is something in the logs? Try echo get_the_excerpt();

V
Vladimir Kulikov, 2018-11-26
@it_proger29

I also had a similar problem. I wrote <?the_excerpt();?> instead of <?php the_excerpt();?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question