You can do it like so:
if (get_page_by_title('Some Title', OBJECT, 'post_type')) {
// Exists
}
post_type can be “post”, “page”, a custom post type slug, etc.
Reference: https://codex.wordpress.org/Function_Reference/get_page_by_title
You can do it like so:
if (get_page_by_title('Some Title', OBJECT, 'post_type')) {
// Exists
}
post_type can be “post”, “page”, a custom post type slug, etc.
Reference: https://codex.wordpress.org/Function_Reference/get_page_by_title