WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Template Directory (4 posts)

  1. ckruse
    Member
    Posted 5 years ago #

    Is there an alternative to:

    bloginfo('template_directory');

    I need the template directory, but I do not want it echoed out. I need it for use in a php script. I know I can use:

    get_option('siteurl);

    and then just append

    /wp-content/themes/themefolder/

    But is there an easier method?

  2. blogmum
    Member
    Posted 5 years ago #

    There's get_bloginfo, which just returns the info rather than echoing it out.

  3. Mark / t31os
    Moderator
    Posted 5 years ago #

    In PHP you can also use dirname, to grab the path from the current file..
    dirname(__FILE__);

    Just to offer a secondary method in terms of creating paths.

  4. ckruse
    Member
    Posted 5 years ago #

    Thanks a lot!

Topic Closed

This topic has been closed to new replies.

About this Topic