Avatar of curiouswebster
Flag for United States of America

asked on 

WordPress & PHP: showing Hello World! only on Page 37?

I want to display a message on Page 37, only. I have tried various methods, including the following:

    if ( $page_id == 37) {
        echo "Hello World!";

But clearly, there is more to get_query_var(). It seems to hang WordPress.

What is the safest way to query the WP page for its ID?

Web DevelopmentPHPWeb Languages and StandardsWordPressWeb Development Software

Avatar of undefined
Last Comment

8/22/2022 - Mon