Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 688087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:11:37+00:00 2026-05-14T02:11:37+00:00

I am using this code in wordpress to display different content when different pages

  • 0

I am using this code in wordpress to display different content when different pages are loaded. I have 5 pages on the site called Home, Bio, Work, Contact and Notes. The Notes page is being used as a blog. Here is the code I am using.

                    <?php if (is_page('contact')) { ?>
                    get in touch with me
                <?php } elseif (is_single()) { ?>
                    a note from me
                <?php } elseif (is_page('notes')) { ?>
                    the notes of me
                <?php } else { ?>
                    the <?php the_title(); ?> of me
                <?php } ?>

So if it the contact page, it displays “get in touch with me” and if it is a single blog post page it displays “a note from me”. However this is where I have a problem. The next statement should display “the notes of me” when it is on the Notes page. However, this does not happen. Instead it shows the default content which is in the “else” statement. any idea on why this is happening?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T02:11:38+00:00Added an answer on May 14, 2026 at 2:11 am

    This is what I would do instead.

                <?php if (is_page('contact')) { ?>
                    get in touch with me
                <?php } elseif (is_page()) { ?>
                    the <?php the_title(); ?> of me
                <?php } elseif (is_single()) { ?>
                    a note from me
                <?php } else { ?>
                    the notes of me
                <?php } ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 532k
  • Answers 532k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Here is the solution I came up with: function url_for($urls,$name,$args)… May 17, 2026 at 12:12 am
  • Editorial Team
    Editorial Team added an answer Solved Turns out that I had originally tried to set… May 17, 2026 at 12:12 am
  • Editorial Team
    Editorial Team added an answer The reason it doesn't work that way makes sense when… May 17, 2026 at 12:12 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm using this piece of code I found ( http://impnerd.com/wordpress-hack-add-post-images-to-your-homepage ) to display the
Why does this code fail to display the category name Apples using the current
I have some user-submitted variables that I want to display in a different part
I'm using PHP to display the most recent tweet from a user. This is
I'm in wordpress, trying to format the date output. This is the code I'm
Within my WP site I have a category called 'events' where I am publishing
This is the page, its a wordpress powered site: http://bit.ly/9oJXWV You select some value,
I'm making a simple website for myself using wordpress and some hacking to try
So I am using Jquery to display a pop up menu on my current
i'm trying to create a portfolio website using wordpress, each post has view costum

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.