Skip to:
Content
Pages
Categories
Search
Top
Bottom

How do I call images in my child theme?


  • Psyber
    Participant

    @psyber

    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)
  • 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

    @psyber

    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.

    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

    @psyber

    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?


    David Carson
    Participant

    @davidtcarson

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


    Psyber
    Participant

    @psyber

    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.


    David Carson
    Participant

    @davidtcarson

    Try replacing “template_url” with “stylesheet_directory”.

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


    Psyber
    Participant

    @psyber

    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