Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm creating a child theme off of wp-framework and in it's header it uses

<?php echo IMAGES . '/favicon.ico'; ?>

to recall the folder where images are kept.

How do I define or create the location in order to recall it using echo IMAGES?

and if I can save the image folder location as IMAGES (If I recall it's a string?) can I do the same with other information?

share|improve this question
    
I'm not sure what you're trying to do here - do you want an image subfolder in your child theme? If so, you can use bloginfo('stylesheet_directory') to get the path to your child theme and then just append /images to it –  anu Apr 28 '11 at 15:42

2 Answers 2

up vote 0 down vote accepted

Many WordPress frameworks include helper functions and pre-defined folder locations. WP Framework is very well coded but requires some learning and inspecting the code to find the documentation.

In the file core.php many constants are defined but I did not see IMAGES but THEME_IMAGE is defined so it is likely that IMAMGE refers to the images folder in the child theme directory.

Here is the list of constants available for you to use:

WP Framework V 3.6 core.php:

function wpf_initial_constants() {  
    // Sets the File path to the current parent theme's directory.
    define( 'PARENT_THEME_DIR', TEMPLATEPATH );

    // Sets the URI path to the current parent theme's directory.
    define( 'PARENT_THEME_URI', get_template_directory_uri() );

    // Sets the File path to the current parent theme's directory.
    define( 'CHILD_THEME_DIR', STYLESHEETPATH );

    // Sets the URI path to the current child theme's directory.
    define( 'CHILD_THEME_URI', get_stylesheet_directory_uri() );

    // Sets the file path to WP Framework
    define( 'WPF_DIR', PARENT_THEME_DIR . '/framework' );

    // Sets the URI path to WP Framework
    define( 'WPF_URI', PARENT_THEME_URI . '/framework' );

    // Sets the file path to extensions
    define( 'WPF_EXT_DIR', WPF_DIR . '/extensions' );

    // Sets the URI path to extensions
    define( 'WPF_EXT_URI', WPF_URI . '/extensions' );
}

/**
 * Templating constants that you can override before WP Framework is loaded.
 *
 * @since 0.3.0
 *
 * @return void
 */
function wpf_templating_constants() {
    // Sets a unique ID for the theme.
    if ( !defined( 'THEME_ID' ) )
        define( 'THEME_ID', 'wpf_' . get_template() );

    // Sets the default theme options db name
    if ( !defined( 'THEME_OPTIONS' ) )
        define( 'THEME_OPTIONS', 'theme_options' );

    // Sets relative paths for the default directories/paths
    if ( !defined( 'THEME_LIBRARY' ) )
        define( 'THEME_LIBRARY', '/library' );

    if ( !defined( 'THEME_I18N' ) )
        define( 'THEME_I18N', THEME_LIBRARY . '/languages' );

    if ( !defined( 'THEME_FUNC' ) )
        define( 'THEME_FUNC', THEME_LIBRARY . '/functions' );

    if ( !defined( 'THEME_IMG' ) )
        define( 'THEME_IMG', THEME_LIBRARY . '/images' );

    if ( !defined( 'THEME_CSS' ) )
        define( 'THEME_CSS', THEME_LIBRARY . '/css' );

    if ( !defined( 'THEME_JS' ) )
        define( 'THEME_JS', THEME_LIBRARY . '/js' );

    // Sets the default custom header image
    if ( !defined( 'DEFAULT_HEADER_IMAGE' ) )
        define( 'DEFAULT_HEADER_IMAGE', get_theme_part( THEME_IMG . '/custom-header.gif' ) );
}
share|improve this answer
    
thanks Chris, I think the other answer is the one I was after. I wasn't able to properly articulate what I was trying to do - however what you have showed me has saved me hours of work now that I know that these constants exist :) –  Screaming Violet Apr 29 '11 at 5:41

If you need to define/redefine a constant:

define( 'IMAGES', 'path/to/images/directory' );

If you need to echo parent-theme\images:

<?php echo get_template_direcory_uri() . '/images'; ?>

If you need to echo child-theme\images:

<?php echo get_stylesheet_direcory_uri() . '/images'; ?>

Or do you need to do something else?

share|improve this answer
    
I think the top one - I need to define a constant (sorry I'm self taught & don't know all the jargon yet) such as the location of the images folder, or the folder where some static html files will reside that kind of thing. –  Screaming Violet Apr 29 '11 at 5:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.