ru-se.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

excerpt-quote.php (612B)


      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 
     12 $content = get_the_content();
     13 
     14 // If there is no quote or pullquote print the content.
     15 if ( has_block( 'core/quote', $content ) ) {
     16 	twenty_twenty_one_print_first_instance_of_block( 'core/quote', $content );
     17 } elseif ( has_block( 'core/pullquote', $content ) ) {
     18 	twenty_twenty_one_print_first_instance_of_block( 'core/pullquote', $content );
     19 } else {
     20 	the_excerpt();
     21 }