Image breaking in a wordpress custom site - php file and problems with root path

20 views Asked by At

I am having trouble with a very simple footer - for some reason. While trying to load an Instagram icon in a footer, while editing a custom WordPress theme, everything seems okay and the image is linking right, but breaking. what could be the possible reasons?

This is what I tried, I would expect to work just fine (used svg. png...:

?>
<footer id="colophon" class="site-footer">
    <div class="site-info">
        <div class="footer-copyright">
            &copy; Mother tongues collective 2023. All rights reserved.
        </div>
        <div class="footer-socials">
            <a href="https://www.instagram.com/mother.tongues_/" target="_blank">
                <!-- #instagram icon -->
                <img src="<?php bloginfo('template-url'); ?>/assets/instagram-icon.png">
            </a>
        </div>
    </div><!-- .site-info -->

    <?php wp_footer(); ?>
</footer><!-- #colophon -->



</body>
</html>

Many thanks in advance for any helpenter image description here

1

There are 1 answers

0
Wongjn On

template-url is an invalid argument for bloginfo() – you may have meant template_url or template_directory:

 <img src="<?php bloginfo('template_url'); ?>/assets/instagram-icon.png">