Custom search results page query, link permalink to post title while separating by post types

I am using Option 3 from this answer as my source. So far it is working great, it is splitting my search results by post type and listing the posts from each post type in their own sections. The only problem is that this solution does not appear to allow for hyperlinking the post titles using the_permalink(); How can I adapt this code so that I can also wrap the post titles in an anchor tag that will direct to the post?

Problem with favicon in the latest wp

Im having a problem with the favicon icon in WordPress 5.4.2. Im including my own favicon in the sites header.php, that is used for wp and wp non related static pages. The problem is that when I open a pdf file inside this site, the wp logo automatically appears as a favicon, instead of my site’s icon. This would not happen in previous wp versions. Is there a way to change the wp icon to my sites icon, or just to nothing?