WordPress.org

Forums

php url for theme image directory to use for image embed in php files? (6 posts)

  1. mxpimp47
    Member
    Posted 4 years ago #

    what i am trying to do is embed images in my php files without having to use a long url like: /wordpress/wp-content/themes/example_theme/images/example_img.jpg

    is there a php line of code that says to use the template theme directory?

  2. Darrell Schauss
    Member
    Posted 4 years ago #

  3. mxpimp47
    Member
    Posted 4 years ago #

    ok thanks now how exactly would i use it? this is what i have what do i replace it with?

    <a href=""><img id="slide-img-1" src="/clayton/wp-content/themes/freestonemx/images/slide_1.gif" class="slide" alt="" /></a>

  4. mxpimp47
    Member
    Posted 4 years ago #

    can anyone give me some advice on how to use that line of code in place of what i have?

  5. Darrell Schauss
    Member
    Posted 4 years ago #

    <a href=""><img id="slide-img-1" src="<?php echo get_bloginfo('template_directory');?>/images/slide_1.gif" class="slide" alt="" /></a>

  6. mxpimp47
    Member
    Posted 4 years ago #

    thank you so much. i am trying to learn exactly how to use php so i can implement the wordpress codex they provide.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.