Forums

[resolved] get_option for template directory (3 posts)

  1. wetwetwafu
    Member
    Posted 1 year ago #

    i have a function in my function.php that has a line like this:

    echo '<img src="http://edward.com/ot/wp-content/themes/default/images/home.png" alt="Home" class="home" /></a> </li> ';

    Then i tried this :
    echo '<img src="'.get_option('home').'/wp-content/themes/default/images/home.png" alt="Home" class="home" /></a> </li> ';

    is there a better way or shorter way to call the template directory?

    How do i use the TEMPLATEPATH in this situation? is it posible?

    Thanks in advance.

  2. MichaelH
    Volunteer
    Posted 1 year ago #

    Here's a list:

    <?php
    echo "ABSPATH ".ABSPATH."<br />";
    echo "WP_CONTENT_DIR ".WP_CONTENT_DIR."<br />";
    echo "WP_CONTENT_URL ".WP_CONTENT_URL."<br />";
    echo "WPINC ".WPINC."<br />";
    echo "WP_PLUGIN_DIR ".WP_PLUGIN_DIR."<br />";
    echo "WP_PLUGIN_URL ".WP_PLUGIN_URL."<br />";
    echo "PLUGINDIR ".PLUGINDIR."<br />";
    echo "WPMU_PLUGIN_DIR ".WPMU_PLUGIN_DIR."<br />";
    echo "WPMU_PLUGIN_URL ".WPMU_PLUGIN_URL."<br />";
    echo "MUPLUGINDIR ".MUPLUGINDIR."<br />";
    echo "Parent theme ".TEMPLATEPATH."<br />";
    echo "Child theme ".STYLESHEETPATH."<br />";
    echo "Parent template_directory ".get_bloginfo('template_directory')."<br />";
    echo "Parent template_url ".get_bloginfo('template_url')."<br />";
    echo "Child stylesheet_directory ".get_bloginfo('stylesheet_directory')."<br />";
    echo "Child stylesheet_url ".get_bloginfo('stylesheet_url')."<br />";
    echo "current_theme option ".get_option('current_theme')."<br />";
    echo "template option ".get_option('template')."<br />";
    echo "stylesheet option ".get_option('stylesheet')."<br />";
    ?>
  3. wetwetwafu
    Member
    Posted 1 year ago #

    Thanks!

    this code works for me. echo "Parent template_directory ".get_bloginfo('template_directory')."<br />";

    My code looks like this:

    echo '<img src="'.get_bloginfo('template_directory').'/images/home.png" alt="Home" class="home" /></a> </li> ';}

    Thanks a lot sir.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags