Support » Themes and Templates » TEMPLATEPATH or bloginfo('template_url')?

Viewing 1 replies (of 1 total)
  • TEMPLATEPATH this is the physical path within the themes folder, to load a file called theme options.

    if (file_exists(TEMPLATEPATH .'/theme-options.php')) include(TEMPLATEPATH .'/theme-options.php');

    Where get_template_directory_uri() can be used to register a custom stylesheet or load a header image at runtime, this is for the HTML rendering and will require the URL

    wp_register_style( 'mycustomstyle', get_template_directory_uri() .'/styles/buckingham.css', '', '0.1' );
    wp_enqueue_style( 'customstyle' );

    This would load the stylesheet at runtime, here is an example where you can see the url for a custom stylesheet, you can see both examples here.

    <link rel='stylesheet' id='customstyle-css'  href='http://theme.digitalraindrops.net/wp-content/themes/raindrops-magazine/styles/buckingham.css?ver=0.1' type='text/css' media='all' />

    For a child theme files that are not in the parent!
    STYLESHEETPATH and get_stylesheet_directory_uri()

    HTH

    David

Viewing 1 replies (of 1 total)
  • The topic ‘TEMPLATEPATH or bloginfo('template_url')?’ is closed to new replies.