No Description

excerpt-quote.php 612B

12345678910111213141516171819202122
  1. <?php
  2. /**
  3. * Show the appropriate content for the Quote post format.
  4. *
  5. * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  6. *
  7. * @package WordPress
  8. * @subpackage Twenty_Twenty_One
  9. * @since Twenty Twenty-One 1.0
  10. */
  11. $content = get_the_content();
  12. // If there is no quote or pullquote print the content.
  13. if ( has_block( 'core/quote', $content ) ) {
  14. twenty_twenty_one_print_first_instance_of_block( 'core/quote', $content );
  15. } elseif ( has_block( 'core/pullquote', $content ) ) {
  16. twenty_twenty_one_print_first_instance_of_block( 'core/pullquote', $content );
  17. } else {
  18. the_excerpt();
  19. }