troubleshooting Question

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

Avatar of curiouswebster
curiouswebsterFlag for United States of America asked on
Web DevelopmentPHPWeb Languages and StandardsWordPressWeb Development Software
6 Comments4 Solutions34 ViewsLast Modified:
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?

Join our community to see this answer!
Unlock 4 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros