You shouldn't have to be an expert to be safe on a computer.

Home

Guides

Seminars

Tips and Tricks

Log in

Get File Path to WordPress Theme

Saturday, November 7th, 2009 (No comments yet)

For some reason, the WordPress team removed the ability to simply get the file path to your theme folder. Here's how to get it quickly:

1
2
3
4
$url = get_bloginfo("template_url");
$temp = explode("wp-content/themes/",$url);
$active_theme_name = $temp[1];	// The second value will be the theme name
$theme_path =get_theme_root()."/".$active_theme_name;

When done, $theme_path will be the file path from the root of your current system to your active theme's folder.

Support the Geek

If you hate ads as much as I do, please consider supporting us by donating or browsing our recommended products


Recommended Products and Services
Quick Tips:

Jsearch - Wordpress Multiple Category, Tag, and Term Search

Jsearch, the most complete search plugin available for Wordpress. Handles multiple categories, tags, and keywords all at the same time. Widget enabled!

[Click for full description]

Get File Path to Wordpress Theme

Here's a tip to get the file path to your current Wordpress theme.

[Click for full description]

Hack Wordpress to Make Postnames Always Editable

When using ordinary permalinks, you're blocked from editing the postname when doing posts and pages. This is senseless and must be stopped!

[Click for full description]