X Theme automates most of this process. To avoid "fighting" with the theme, I'd first remove the code you entered (that evidently broke your site) and do it the X theme way:
From your dashboard:
appearance>customize>header>LOGO – IMAGE and click "Select Image"
If it does not link to your homepage, you may not have defined a page as being your homepage. In that case, return to your wordpress dashboard and go:
settings > reading >Front page displays > *Static Page > select a page to be your home page