Support

Account

Home Forums Gutenberg How to get the id of the current page while in edit mode? Reply To: How to get the id of the current page while in edit mode?

  • There isn’t anything in ACF that I know of, and most of the things you can do could also be considered “hokey”

    you can try

    
    global $post;
    echo $post->post_title;
    

    you can also try looking that the query string

    
    echo get_the_title($_GET['post']);
    

    You may also be able to use

    
    $post = get_queried_object();
    

    I’m not exactly sure which, if any, of the above will work with what you’re trying to do.