Advertisement
Guest User

Untitled

a guest
Apr 9th, 2013
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.97 KB | None | 0 0
  1. <?php
  2. /**
  3. * Defines the necessary constants and includes the necessary files for Thesis’ operation.
  4. *
  5. * Many WordPress customization tutorials suggest editing a theme’s functions.php file. With
  6. * Thesis, you should edit the included custom/custom_functions.php file if you wish
  7. * to make modifications.
  8. *
  9. * @package Thesis
  10. * 1.8.5.2
  11. */
  12. // Define directory constants
  13.  
  14. define('THESIS_LIB', TEMPLATEPATH . '/lib');
  15. define('THESIS_ADMIN', THESIS_LIB . '/admin');
  16. define('THESIS_CLASSES', THESIS_LIB . '/classes');
  17. define('THESIS_FUNCTIONS', THESIS_LIB . '/functions');
  18. define('THESIS_CSS', THESIS_LIB . '/css');
  19. define('THESIS_HTML', THESIS_LIB . '/html');
  20. define('THESIS_SCRIPTS', THESIS_LIB . '/scripts');
  21. define('THESIS_IMAGES', THESIS_LIB . '/images');
  22.  
  23. if (isset($_REQUEST['template']) && isset($_REQUEST['stylesheet']) && (isset($_REQUEST['customize']) && $_REQUEST['customize'] === 'on') || (isset($_REQUEST['preview']) && ! empty($_REQUEST['preview'])))
  24. define('THESIS_NEW_WP_PREVIEW', true);
  25.  
  26. if (@file_exists(STYLESHEETPATH . "/custom"))
  27. define('THESIS_CUSTOM', STYLESHEETPATH . "/custom" . (is_multisite() && ! defined('THESIS_NEW_WP_PREVIEW') ? "-$blog_id" : ''));
  28. else
  29. define('THESIS_CUSTOM', TEMPLATEPATH . "/custom" . (is_multisite() && ! defined('THESIS_NEW_WP_PREVIEW') ? "-$blog_id" : ''));
  30.  
  31. // Define folder constants
  32. define('THESIS_CSS_FOLDER', get_bloginfo('template_url') . '/lib/css'); #wp
  33. define('THESIS_SCRIPTS_FOLDER', get_bloginfo('template_url') . '/lib/scripts'); #wp
  34. define('THESIS_IMAGES_FOLDER', get_bloginfo('template_url') . '/lib/images'); #wp
  35.  
  36. if (@file_exists(THESIS_CUSTOM)) {
  37. if (@file_exists(STYLESHEETPATH . "/custom"))
  38. define('THESIS_CUSTOM_FOLDER', get_bloginfo('stylesheet_directory') . '/custom' . (is_multisite() && ! defined('THESIS_NEW_WP_PREVIEW') && get_option('thesis_design_options') ? "-$blog_id" : '')); #wp
  39. else
  40. define('THESIS_CUSTOM_FOLDER', get_bloginfo('template_url') . '/custom' . (is_multisite() && ! defined('THESIS_NEW_WP_PREVIEW') ? "-$blog_id" : '')); #wp
  41. define('THESIS_LAYOUT_CSS', THESIS_CUSTOM . '/layout.css');
  42. define('THESIS_ROTATOR', THESIS_CUSTOM . '/rotator');
  43. define('THESIS_ROTATOR_FOLDER', THESIS_CUSTOM_FOLDER . '/rotator');
  44. }
  45. elseif (file_exists(TEMPLATEPATH . '/custom-sample')) {
  46. define('THESIS_SAMPLE_FOLDER', get_bloginfo('stylesheet_directory') . '/custom-sample'); #wp
  47. define('THESIS_LAYOUT_CSS', TEMPLATEPATH . '/custom-sample/layout.css');
  48. define('THESIS_ROTATOR', TEMPLATEPATH . '/custom-sample/rotator');
  49. define('THESIS_ROTATOR_FOLDER', THESIS_SAMPLE_FOLDER . '/rotator');
  50. }
  51.  
  52. // Load classes
  53. require_once(THESIS_CLASSES . '/comments.php');
  54. require_once(THESIS_CLASSES . '/css.php');
  55. require_once(THESIS_CLASSES . '/data.php');
  56. require_once(THESIS_CLASSES . '/favicon.php');
  57. require_once(THESIS_CLASSES . '/head.php');
  58. require_once(THESIS_CLASSES . '/javascript.php');
  59. require_once(THESIS_CLASSES . '/loop.php');
  60. require_once(THESIS_CLASSES . '/options_design.php');
  61. require_once(THESIS_CLASSES . '/options_page.php');
  62. require_once(THESIS_CLASSES . '/options_site.php');
  63. require_once(THESIS_CLASSES . '/options_terms.php');
  64. require_once(THESIS_CLASSES . '/widgets.php');
  65.  
  66. // Admin stuff
  67. if (is_admin()) { #wp
  68. require_once(THESIS_ADMIN . '/file_editor.php');
  69. require_once(THESIS_ADMIN . '/fonts.php');
  70. require_once(THESIS_ADMIN . '/header_image.php');
  71. require_once(THESIS_ADMIN . '/options_manager.php');
  72. require_once(THESIS_ADMIN . '/options_post.php');
  73. require_once(THESIS_ADMIN . '/admin.php');
  74. }
  75.  
  76. // Load template-based function files
  77. require_once(THESIS_FUNCTIONS . '/comments.php');
  78. require_once(THESIS_FUNCTIONS . '/compatibility.php');
  79. require_once(THESIS_FUNCTIONS . '/content.php');
  80. require_once(THESIS_FUNCTIONS . '/document.php');
  81. require_once(THESIS_FUNCTIONS . '/feature_box.php');
  82. require_once(THESIS_FUNCTIONS . '/helpers.php');
  83. require_once(THESIS_FUNCTIONS . '/multimedia_box.php');
  84. require_once(THESIS_FUNCTIONS . '/nav_menu.php');
  85. require_once(THESIS_FUNCTIONS . '/post_images.php');
  86. require_once(THESIS_FUNCTIONS . '/teasers.php');
  87. require_once(THESIS_FUNCTIONS . '/version.php');
  88. require_once(THESIS_FUNCTIONS . '/multisite.php');
  89.  
  90. // Load HTML frameworks
  91. require_once(THESIS_HTML . '/content_box.php');
  92. require_once(THESIS_HTML . '/footer.php');
  93. require_once(THESIS_HTML . '/frameworks.php');
  94. require_once(THESIS_HTML . '/header.php');
  95. require_once(THESIS_HTML . '/hooks.php');
  96. require_once(THESIS_HTML . '/sidebars.php');
  97. require_once(THESIS_HTML . '/templates.php');
  98.  
  99. // Launch Thesis within WordPress
  100. require_once(THESIS_FUNCTIONS . '/launch.php');
  101.  
  102. // include a sitewide custom_functions file in multisite
  103. if (is_multisite() && @file_exists(TEMPLATEPATH . "/custom/custom_functions.php"))
  104. include_once(TEMPLATEPATH . "/custom/custom_functions.php");
  105.  
  106. // Include the user's custom_functions file, but only if it exists
  107. if (@file_exists(THESIS_CUSTOM . '/custom_functions.php'))
  108. include_once(THESIS_CUSTOM . '/custom_functions.php');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement