Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of hnla

How do I call images in my child theme? (9 posts)

Started 1 year, 9 months ago by: psyber

  • Profile picture of psyber Psyber said 1 year, 9 months ago:

    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>”

  • Profile picture of dre1080 dre1080 said 1 year, 9 months ago:

    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?

  • Profile picture of psyber Psyber said 1 year, 9 months ago:

    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.

  • Profile picture of dre1080 dre1080 said 1 year, 9 months ago:

    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

  • Profile picture of psyber Psyber said 1 year, 9 months ago:

    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?

  • Profile picture of David Carson David Carson said 1 year, 9 months ago:

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

  • Profile picture of psyber Psyber said 1 year, 9 months ago:

    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.

  • Profile picture of David Carson David Carson said 1 year, 9 months ago:

    Try replacing “template_url” with “stylesheet_directory”.

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

  • Profile picture of psyber Psyber said 1 year, 9 months ago:

    That worked, thanks for the lesson.