First off, take a look at Conditional Tags in general.
I am trying to understand what the is_singular() function does.
Straight from the codex: “This conditional tag checks if a singular post is being displayed, which is the case when one of the following returns true: is_single(), is_page() or is_attachment().“
What I really need to do is determine if a page is a category page.
The conditional tag that applies here would be is_category(), which returns true, if a category archive page is displayed.
But the problem is that I am not sure how to determine which are single-view pages, regular pages, and category pages.
As you do not care about attachment pages, is_singular() obviously isn’t for you.
Still something can be learned from its description – namely, the other two tags (the category one aside) needed to determine whether your condition is met:
is_single() and is_page()
Hence,
if ( is_single() || is_page() || is_category() ) {
// do your thing
}
is what you want.
Should chaining of expressions in PHP be new to you, take a look at its logical operators.