Rincewind on "[Plugin: WP Realtime Sitemap] Find ID of Custom Post Types"

ساخت وبلاگ

I'm trying to exclude certain custom post types from the sitemap. I don't know how to find the numerical ID of the custom post types to exclude. Any tips?

https://wordpress.org/plugins/wp-realtime-sitemap/

How did you create the custom post type ? should tell you where you created in.

axlright
Member
Posted 50 minutes ago #

Thank you for getting back so quicklu. The custom post types were created using a plugin called "Custom Post Type UI" https://wordpress.org/plugins/custom-post-type-ui/

I'll reach out to them. There's nothing in their interface I can find that displays the ID of each custom post type.

axlright
Member
Posted 25 minutes ago #

Is there any other way to exclude custom post types except by their ID?

I've tried that plugin and your right it doesn't show the ID of the custom post type, have looked in the WordPress codex, and there isn't a function that is capable of getting the id of the custom post type.

So I'm not sure how you get the custom post id now, if you find out could you please let me know, I may be able to add something that shows all the custom post types and then you can pick the one you want from a drop down menu, this however may not be possible, but its something I will look into if you ever find out how to get the custom post type id.

No the get_posts function that is built into WordPress that I use to get all the posts will only accept a numerical post id.

https://codex.wordpress.org/Template_Tags/get_posts

- - , .
.

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 268 تاريخ : شنبه 26 تير 1395 ساعت: 4:33