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 289801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:56:24+00:00 2026-05-12T05:56:24+00:00

In a previous post ( Don't show this if the url contains the following

  • 0

In a previous post (Don't show this if the url contains the following) I asked how I would go about having my header echo a div if the user loaded a URL with /blog in the header.

What I didn’t take into consideration, was that I don’t want the div to display if its not just got /blog in the url, but if its any blog post, not just the index page of the blogs.

How do I run a bit of code from my header.php if the page I’m looking at is a blog post?

  • 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-12T05:56:24+00:00Added an answer on May 12, 2026 at 5:56 am

    You would use the WordPress functions is_single() and is_page.

    if(!is_single() && !is_page() && !is_home() && !is_archive())
    {
    /* This will not display for any post, page, the home page, or an archive.
     You can remove each is statement according to your needs */
    }
    

    For only posts, only use is_single, the same for page, home, and archive.

    The full listing of is_statements can be found here. Here are some others:

    is_home() : Home Page
    is_front_page :  Front Page
    is_single() :  Single Post
    is_admin() : Admin Panel
    is_sticky() : Sticky Post
    is_page() : Page
    is_category
    is_tag
    is_author
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I posted about this a few weeks ago, but I don't think I asked
This is a follow up to my previous question about using XMLHttpRequest() to post
in my previous post I was asking how to generate numbers following a normal
This relates to my previous post: jQuery .load Method causing page refresh AJAX I
This is a previous post detailing a CI setup for Python. The asker and
I looked at previous post based on this but they do not relate. I
This post if a follow-up question to mt previous post: Android RESTful Web application
This question is related to a previous post of mine Here . Basically, I
This post is the continuation of my previous post . Now I have a
This question is following a previous one which i posted: Django Callback on Facebook

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.