post_type incorrect for custom post type

The comment

get_post_type() is not a complicated function

led me to disable the Relevanssi plugin that I was using for search and determined that “Create custom search result snippets” setting had been selected and was causing issues with the post type being returned. Once I unchecked this, everything worked.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)