• Resolved carlosonweb

    (@carlosonweb)


    Hi,

    Can you please explain why the get_the_title() function is empty when called on some sections of the Singular Event page?

    To reproduce, activate the Twenty Twenty Theme or its child theme and add the code below to the functions.php file.

    
    add_action( 'wp_body_open', function(){
    	echo '<h1 style="color: red">' . get_the_title() . '</h1>';
    } );
    

    View a single post page and an event page. You’ll see that it renders fine on the post page, but displays nothing (or empty) in the singular event page.

    Please clarify or provide a workaround.

    Thanks in advance.

    Best regards,

    Carlos

  • The topic ‘get_the_title() Is Empty On The Singular Event Page’ is closed to new replies.