Advertisement
richardmhowell

functions.php Parent

Mar 21st, 2012
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.26 KB | None | 0 0
  1. <?php
  2.  
  3. /*-----------------------------------------------------------------------------------*/
  4. /* Start WooThemes Functions - Please refrain from editing this section */
  5. /*-----------------------------------------------------------------------------------*/
  6.  
  7. // Set path to WooFramework and theme specific functions
  8. $functions_path = TEMPLATEPATH . '/functions/';
  9. $includes_path = TEMPLATEPATH . '/includes/';
  10.  
  11. // Don't load alt stylesheet from WooFramework
  12. if (!function_exists( 'woo_output_alt_stylesheet')) {
  13.     function woo_output_alt_stylesheet() {}
  14. }
  15.  
  16. // WooFramework
  17. require_once ($functions_path . 'admin-init.php');          // Framework Init
  18.  
  19. if (get_option('woo_woo_tumblog_switch') == 'true') {
  20.     //Enable Tumblog Functionality and theme is upgraded
  21.     update_option('woo_needs_tumblog_upgrade', 'false');
  22.     update_option('tumblog_woo_tumblog_upgraded', 'true');
  23.     update_option('tumblog_woo_tumblog_upgraded_posts_done', 'true');
  24.     require_once ($functions_path . 'admin-tumblog-quickpress.php');    // Tumblog Dashboard Functionality
  25. }
  26.  
  27. /*-----------------------------------------------------------------------------------*/
  28. /* Load the theme-specific files, with support for overriding via a child theme.
  29. /*-----------------------------------------------------------------------------------*/
  30.  
  31. $includes = array(
  32.                 'includes/theme-options.php',           // Options panel settings and custom settings
  33.                 'includes/theme-functions.php',         // Custom theme functions
  34.                 'includes/theme-plugins.php',           // Theme specific plugins integrated in a theme
  35.                 'includes/theme-actions.php',           // Theme actions & user defined hooks
  36.                 'includes/theme-comments.php',          // Custom comments/pingback loop
  37.                 'includes/theme-js.php',                // Load JavaScript via wp_enqueue_script
  38.                 'includes/sidebar-init.php',            // Initialize widgetized areas
  39.                 'includes/theme-widgets.php'            // Theme widgets
  40.                 );
  41.  
  42. // Theme-Specific
  43. $includes[] = 'includes/theme-advanced.php';            // Advanced Theme Functions
  44. $includes[] = 'includes/theme-shortcodes.php';          // Custom theme shortcodes
  45. // Modules
  46. $includes[] = 'includes/woo-layout/woo-layout.php';
  47. $includes[] = 'includes/woo-meta/woo-meta.php';
  48. $includes[] = 'includes/woo-hooks/woo-hooks.php';
  49.  
  50. // Allow child themes/plugins to add widgets to be loaded.
  51. $includes = apply_filters( 'woo_includes', $includes );
  52.            
  53. foreach ( $includes as $i ) {
  54.     locate_template( $i, true );
  55. }
  56.  
  57. if (get_option('woo_woo_tumblog_switch') == 'true') {
  58.  
  59.     define( 'WOOTUMBLOG_ACTIVE', true ); // Define a constant for use in our theme's templating engine.
  60.  
  61.     require_once ($includes_path . 'tumblog/theme-tumblog.php');        // Tumblog Output Functions
  62.     // Test for Post Formats
  63.     if (get_option('woo_tumblog_content_method') == 'post_format') {
  64.         // Tumblog Post Format Class
  65.         require_once( $includes_path . 'tumblog/wootumblog_postformat.class.php' );
  66.     } else {
  67.         // Tumblog Custom Taxonomy Class
  68.         require_once ($includes_path . 'tumblog/theme-custom-post-types.php');  // Custom Post Types and Taxonomies
  69.     }
  70.    
  71.     // Test for Post Formats
  72.     if (get_option('woo_tumblog_content_method') == 'post_format') {
  73.         //Tumblog Post Formats
  74.         global $woo_tumblog_post_format;
  75.         $woo_tumblog_post_format = new WooTumblogPostFormat();
  76.         if ( $woo_tumblog_post_format->woo_tumblog_upgrade_existing_taxonomy_posts_to_post_formats()) {
  77.             update_option('woo_tumblog_post_formats_upgraded','true');
  78.         }
  79.        
  80.     }
  81. }
  82.  
  83. // Output stylesheet and custom.css after Canvas custom styling
  84. remove_action('wp_head', 'woothemes_wp_head');
  85. add_action('woo_head', 'woothemes_wp_head');
  86. if (get_option('woo_woo_tumblog_switch') == 'true' && get_option('woo_custom_rss') == 'true') {
  87.     add_filter('the_excerpt_rss', 'woo_custom_tumblog_rss_output');
  88.     add_filter('the_content_rss', 'woo_custom_tumblog_rss_output');
  89. }
  90.  
  91. /*-----------------------------------------------------------------------------------*/
  92. /* You can add custom functions below */
  93. /*-----------------------------------------------------------------------------------*/
  94.  
  95.  
  96. /*-----------------------------------------------------------------------------------*/
  97. /* Don't add any code below here or the sky will fall down */
  98. /*-----------------------------------------------------------------------------------*/
  99. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement