Wordpress page question

Posted on 2011-10-26
Last Modified: 2012-05-12
Hi Experts,

I'd like to test for a particular page i.e.  so I can execute a particular script if that page is being rendered.

Something like this: <?php if(is_front_page()) { ?>
except it's testing for a particular page

Any ideas?



Question by:HelpNearMe
    LVL 19

    Expert Comment

    How about:

    if ("$_SERVER["HTTP_HOST"]/$_SERVER["REQUEST_URI"]" = "") {
    LVL 70

    Accepted Solution

    You do this with the is_page() function in WordPress:


    is_page( 'thankyou' ) {
     do something;

    Author Closing Comment

    worked thanks!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
    The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now