Added logic to get the right post from the API matching the WP ID for single posts