Custom Conditional for Blog Post

I'm using Genesis Extender. I'm trying to create a Custom Conditional that will just show Blog Posts. I used is_home() but that only gets me a widget area for the home page of the blog. is_single() would work but the subsequent widget area shows up on my custom post types too. Is there a conditional for Blog Posts?

The site is https://www.gochicago.com/
The blog where I want to place the widget is
https://www.gochicago.com/news/
There is a widget on the home page of the blog but not on individual pages.

Hopefully the solution would work on individual blog pages as well as future category pages.

It sounds like you need to combine a few conditionals to make this happen. If they are "either/or" kinds of scenarios (i.e.. display here OR here) then you can just create two conditionals and then assign both of them to your Custom Widget Area or Hook Box. But if they are "this AND that" kinds of scenarios then you'd need to do that inside a single Custom Conditional (i.e.. display here AND here). The latter requires the use of the && code separating your two conditional tags like so:

is_archive() && !is_category()

(&& = and / ! = not) So the above conditional set would say "display on archive pages, but not category archive pages" and you would type this kind of combo inside the same Custom Conditional tag area.

Note that I'm not sure exactly what combination you need here because I'm still not 100% clear what you're going for, but if you're still having trouble just clarify a bit more on your reply and I'll see what I can come up with. It sounds like you want your Widget Area to display on your main blog page and your single post pages as well, but as I said I'm not very clear at on that.

Sorry I wasn't too clear. I can see that I might need a combination of two conditionals but I am not sure what the conditional would be. I figured out that with is_home() i can create a widget area for the home page of the blog (https://www.gochicago.com/news/)

However, I can't figure out what conditional will give me a widget area for the rest of the blog. For instance:
https://www.gochicago.com/news/deep-dish-and-hot-dogs/
https://www.gochicago.com/news/spotlight-on-navy-pier/
https://www.gochicago.com/news/springtime-in-chicago/

Any thoughts?

As you sais, is_home() covers the blog page itself, but the other links you provided are single post pages. So this would be an "either/or" scenario, which can be handled with two different Custom Conditionals, both selected in the Widget Area in question. So you'd have your is_home() conditional and then to cover the single post pages you'd need to create an is_single() conditional (I believe this is "Is Single Post" in the conditional examples drop-down). So just have those two Custom Conditionals created and then select both of them in your Custom Widget Area and then see what happens.

Thanks for the response. I agree that it needs to have two different Custom Conditionals. What I cant figure out is what exactly the second custom conditional should be. is_single() does not work. It puts the widget area on many different pages of the site. Not just the blog pages. The clarify, it puts them on all the custom post type pages in the site. Is there another conditional that would put the widget on just the blog pages? Are the options available to is_single() that go into between the brackets?

That's odd. Maybe I'm forgetting something here, but I thought that is_single() only affected single blog post pages, not custom post type pages. For custom post types I would use is_singular(). Can you double check and make sure you're not using is_singular()?

I'm no expert. I think I know enough to be dangerous.
I found a combination that seems to work. is_home() as you said above worked. I also used is_singular( 'post' ) which seemed to do the trick. Thanks for working on this with me. I appreciate it. I have a widget area that appears on all the blog pages but not the custom post types.

Great! And yes, is_singular( 'post' ) should definitely do the trick. 🙂

Log in to reply