Skip to:
Content
Pages
Categories
Search
Top
Bottom

How do I call images in my child theme?

  • @psyber

    Participant

    Just need a little help here, I have tried this in multiple instances with no success and I can’t seem to get the path right.

    “_inc/images/homepage_placeholder.jpg>”

Viewing 8 replies - 1 through 8 (of 8 total)
  • @dre1080

    Member

    you have write out the whole path Image
    thats the only way i got it to work with my theme..alt attribute is for web crawlers and search engines, incase the image doesnt load..
    thats how you would call it using the bp-default theme, depends where you placed your theme?

    @psyber

    Participant

    the damn PHP part doesn’t show up when I post it here

    , I’m not really into using absolute paths, this has to work.

    @dre1080

    Member

    or you could create a div then set a background-image, width and height with css..
    called mydiv or whatever, there doesnt have to be anything inside it..

    #mydiv {
    display:block;
    height: 100px;
    width:100px; //whatever the dimensions of your image is
    background-image: url(“../images/homepage_placeholder.jpg”);
    }

    the buddypress themes dont get the image if you dont use absolute paths for in your template
    i dont know of another way to make it work with selector

    @psyber

    Participant

    thanks for your help dre1080, I’m not sure why this aspect of the child theme concept wouldn’t work.

    So it is required that I use absolute paths in my child theme for images?

    @davidtcarson

    Participant

    bloginfo(‘stylesheet_directory’); should call your child theme address dynamically.

    @psyber

    Participant

    Right now the stylesheet_directory is “template_url”

    This is a custom page template that resides in the same directory as the stylesheet, all of this is located in my child theme.

    Thanks for the help.

    @davidtcarson

    Participant

    Try replacing “template_url” with “stylesheet_directory”.

    https://codex.wordpress.org/Template_Tags/bloginfo

    @psyber

    Participant

    That worked, thanks for the lesson.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How do I call images in my child theme?’ is closed to new replies.
Skip to toolbar