Strict Standards: Redefining already defined constructor for class bbdb in /home/themes/public_html/forums/bb-includes/db-mysql.php on line 12

Strict Standards: Declaration of BB_Walker_Blank::start_lvl() should be compatible with BB_Walker::start_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_lvl() should be compatible with BB_Walker::end_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::start_el() should be compatible with BB_Walker::start_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_el() should be compatible with BB_Walker::end_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127
relative path to image file from functions.php « ThemeShaper Forums

ThemeShaper Forums » Thematic


relative path to image file from functions.php

(3 posts)
  • Started 5 years ago by gaillen
  • Latest reply from michaelh
  • This topic is resolved
  1. gaillen

    I am using functions.php in my child theme of Thematic to add a background image. The hook works fine but only with an absolute path to the referenced image. If I try to use a relative path such as I use in my child themes CSS the image is not found.

    function full_page_background_image() { ?>
    <img src="/mandala2.jpg" alt="background image" id="full_page_bg" />
    add_action('thematic_before', 'full_page_background_image');

    Can anyone advise me on the relative path to use? my "child_theme" folder resides beside the "thematic" folder in the normal wordpress "themes" folder and I am not using a sub folder for images yet.

    Posted 5 years ago #
  2. gaillen

    Ok found the answer through trial and error. I had tried

    <?php bloginfo('template_directory'); ?>

    with no luck but I finally found a reference on WP Codex to child themes needing to be referenced through the stylesheets directory

    <?php bloginfo('stylesheet_directory'); ?>

    And yes this does work and answers my question. Here is the final code for reference sake if anyone is searching this in the future

    function full_page_background_image() { ?>
    <img src="<?php bloginfo('stylesheet_directory'); ?>/image_name.jpg" alt="background image" id="full_page_bg" />
    add_action('thematic_before', 'full_page_background_image');
    Posted 5 years ago #
  3. michaelh

    Edit: realized I put stuff in the wrong directory, please delete. :(

    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GA_Filter::spool_analytics() should not be called statically in /home/themes/public_html/forums/bb-includes/wp-functions.php on line 586

Strict Standards: Non-static method GA_Filter::spool_this() should not be called statically in /home/themes/public_html/forums/my-plugins/googleanalytics.php on line 183