BuddyBoss Home – Web Support Forums Themes Boss. theme Images in child-theme's "images" folder now showing up

Viewing 4 posts - 1 through 4 (of 4 total)
  • Question

    #42154
    @snikay

    Hi!
    I’m trying to set an image in a .php child-theme file.

    This is what I’m using:

    <img src="<?php echo get_bloginfo('template_directory');?>/images/example.png" />

    Tried also with the help of this:
    https://codex.wordpress.org/Function_Reference/bloginfo

    But I can’t get it working. The image just won’t show up.

    Answers

    #42203

    Alyssa
    Participant
    @alyssa-buddyboss

    @snikay from http://codex.wordpress.org/Function_Reference/bloginfo
    'template_url' / 'template_directory' - URL of the active theme's directory ('template_directory' was a local path before 2.6; see get_theme_root() and get_template() for hackish alternatives.) Within child themes, both get_bloginfo('template_url') and get_template() will return the parent theme directory. Consider echoing get_template_directory_uri() instead (for the parent template directory) or get_stylesheet_directory_uri() (for the child template directory).

    #42212
    @snikay

    OH! I totally understood that wrong. Thanks so much!

    #42247

    Alyssa
    Participant
    @alyssa-buddyboss

    Any time 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • The question ‘Images in child-theme's "images" folder now showing up’ is closed to new replies.