Forums

[resolved] get_stylesheet_directory and get_theme_root - need help... (6 posts)

  1. Spencer Hill
    Member
    Posted 2 years ago #

    I'm working on this site: http://west-valley-community-church.theportlandco.com/

    And I'm trying to give the path to the theme to my images. I attempted using: get_stylesheet_directory and get_theme_root but neither of them are printing their path for some reason once prepend them to my image path.

    Can someone furnish an example of an image using a "path to theme" function? I assume WordPress has this function built in already?

    Thanks!

  2. TheMacFeed
    Member
    Posted 2 years ago #

    Hey, you helped me earlier, can you please reply http://wordpress.org/support/topic/284090?replies=4#post-1118043

  3. ClaytonJames
    Member
    Posted 2 years ago #

    I'm trying to give the path to the theme to my images.

    Is this of any use at all?

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

    Here is a reference: http://codex.wordpress.org/Bloginfo#Usage

  4. EMG
    Member
    Posted 2 years ago #

    If you're using paths to link to your images within the theme, this is the formatting you would use using your above example:

    <img src="<?php bloginfo('stylesheet_directory'); ?>/images/XYZ.png" alt="" title="" />

  5. Spencer Hill
    Member
    Posted 2 years ago #

    That's perfect. Thank you very much!

  6. ClaytonJames
    Member
    Posted 2 years ago #

    You're welcome.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.