Query loop does not work for custom post type in block theme

[ad_1]

Here is the deal: I’m building a website for myself upon Twenty Twenty Three theme only to give a try to the full site editing development stuff.

I found my problem while trying to enqueue some scripts to my projects custom post type’s single template. Neither is_single() nor is_singular() returns nothing but false for the post type, but works fine with regular posts.

I’ve tried to eval both functions in tons of ways, by parameters or logical comparison. I saw some SO posts, but none have worked so far. I also looked into the git PRs for that matter, but still no solution.

What am I doing wrong?

Am I missing some arg while creating the post type? Is this still a unfixed bug from the newest version?

Have someone here ran into the same problem and solved it without recurring to lousy solutions like exploding $_SERVER[“REQUEST_URI”] ?

I don’t want to start an WP query and search for a given post every time a user access a single project url.

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer