Exclude a specific post in a Custom Post Type

The problem is get_page_by_title, it defaults to post type page so you will need to tell it to target the correct post_type.

Going by your post type sessions, this is what you need.

get_page_by_title('Duck', OBJECT, 'sessions');

The second argument is the type of output, the default is OBJECT so thats what I used as well

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