ThemeShaper Forums » Thematic

custom header image API help needed

(4 posts)
  • Started 3 years ago by danno
  • Latest reply from snack
  • This topic is resolved

Tags:

  1. danno
    Member

    I'm attempting to implement the custom header API into a child theme to allow users to upload their own header in the back end. I've almost got it. However, I'm struggling with one issue in the functions.php file. There is one line that sets the default image

    define('HEADER_IMAGE', '%s/images/image.jpg'); // %s is theme dir uri, set a default image

    The "%s" sets the directory to "thematic" and not my child theme directory. Anyone know how to get it to point to my child theme directory to locate the image?

    Posted 3 years ago #
  2. Hey,

    try:

    define('HEADER_IMAGE', get_bloginfo('stylesheet_directory') . '/images/image.jpg');

    Cheers,

    Chris

    Posted 3 years ago #
  3. danno
    Member

    That did it. Thanks a million, Chris!!

    Posted 3 years ago #
  4. snack
    Member

    oh thats sweet. but ... i notice it works great from functions.php, but not from a sidebar template. is there something more universal?

    Posted 2 years ago #

RSS feed for this topic

Reply

You must log in to post.