I’m working on an application using WP as my CMS. I was successfully creating new posts and working with them in my app.
But I noticed when visitors went to the website they were being listed in the blog (in the loop). I don’t want them to show up there so after doing some research I decided to change my post type from “post” to “page”. Now the posts no longer show up on the blog page!
But now, I noticed, my “pages” are showing up as menu items across the top of the page. This is not what I want.
Is it OK to change the type to something else that WP isn’t using? For example, can I change the type to “document” and everything be OK?
I missed the actual question here, it is perfectly save to change
post to a custom post type. Just make sure to assign the build in taxonomies to the custom post type if you need them and if you already have some kind of hierarchy build through them.
Also make sure that you properly register your post type to suite your exact needs
I’m not sure how you would want to have your setup to look like, but from what I read, you can actually do the following
Create a non-hierarchical post type and simply change your posts to this new post type. Custom post types are excluded from the main query (except on taxonomy and custom post type archive pages (which you can “switch off”)) and menus. You can use
pre_get_posts if you need to add custom post type posts to some archive.
You can also assign custom taxonomies to them (or even the build in taxonomies
post_format) and have them work exactly like normal posts. Changing
page have other issues that you don’t need, as pages have its own methods how it works and how it is dished up in front end. Also, as I previously described in another answer to one of your questions,
page does not have taxonomie and are not meant to have taxonomies.
Set a static front page.
Set a custom tag or category to the posts and use
pre_get_posts to exclude them from the loop.
Simply remove the loop from the homepage if you do ot need it. This will however have the drawback that pagination will still work, so you would need to remove this as well
Go-to your dashboard and followed by
Appearance -> menus.
Here your pages are automatically added as menus. Just uncheck the checkbox. The menus won’t be there with your page titles.