Path to theme, module, or library - drupal_get_path ()

There are many instances where you need to get the path to a theme, a module or a library. Here are some possible methods:

Path to Current Theme

//$GLOBALS['theme'] gives you the name of the current theme
$sThemePath = drupal_get_path('theme',$GLOBALS['theme']);

WARNING: Looking up the path to a specific theme should be avoided as the logic will not allow correct function with anything but the specific theme. Hardcoding a theme name should be avoided, use $GLOBALS['theme'] instead.
Warning 2: path_to_theme() does not quite give you what you think it does. Read the documentation carefully

Path to Module

= drupal_get_path('module', 'moduleNameGoesHere');

Path to Library

//Notice, this is NOT the drupal_get_path function.
$sLibraryPath = libraries_get_path('machineNameOfLibraryGoesHere');