I am making a template with materializecss, the problem comes when I decide to make the logo of the theme dynamic so that it can be changed from wordpress itself. Ok, the problem is that if I now want to put an id with the styles in the image or the image inside a div with said id, those styles are not applied to me, it is not displayed directly in the element inspector.
<body <?php body_class(); ?>>
<a href="#!" class="brand-logo">
<div id="logo">
<img id="logo" alt=""><?php the_custom_logo(); ?></img>
</div>
<?php
// Si no hay logo personalizado, solo mostrara el titulo de la pagina
if (!has_custom_logo()) {
?>
<h1><?php bloginfo('name'); ?></h1>
<?php
}
?></a>
IDs have to be unique on the page.
And you don't need to use an id for the image, this rule would suffice:
Documentation: https://developer.mozilla.org/es/docs/Web/HTML/Atributos_Globales/id