Ejemplo n.º 1
0
 /**
  * Generates semantic classes for BODY element
  *
  * @param array $classes body classes
  */
 function thematic_body_class($classes)
 {
     /**
      * Filter to control the theme layout
      *
      * Accepts any string that is part of thematic_available_theme_layouts(). Note that
      * the filter overrides the layout defined in the Theme Customizer. Any invalid
      * layout string will be ignored and the theme's default layout will be used.
      *
      * @see thematic_available_theme_layouts()
      *
      * @since 2.0.0
      *
      * @param string $current_layout
      */
     $current_layout = apply_filters('thematic_current_theme_layout', thematic_get_theme_opt('layout'));
     if (is_page_template('template-page-fullwidth.php')) {
         $classes[] = 'full-width';
     } elseif (in_array($current_layout, thematic_available_layout_slugs())) {
         $classes[] = $current_layout;
     } else {
         $classes[] = thematic_default_theme_layout();
     }
     if (thematic_is_legacy_xhtml()) {
         $classes[] = 'thematic-xhtml';
     }
     /**
      * Filter the body classes
      * 
      * @param array $classes
      */
     return apply_filters('thematic_body_class', $classes);
 }
Ejemplo n.º 2
0
 function test_xhtml_mode_set_by_upgrade()
 {
     // set pre-upgrade options
     $this->update_theme_option($this->pre_upgrade_opt);
     // run upgrade routine - function is hooked to admin_init
     thematic_opt_init();
     $this->assertEquals('right-sidebar', thematic_get_theme_opt('layout'));
     $this->assertTrue(thematic_is_legacy_xhtml());
     $this->delete_theme_option();
 }
Ejemplo n.º 3
0
 /**
  * thematic_theme_setup
  *
  * @todo review for impact of deprecations on child themes & fix comment blocks?
  * @since 1.0.0?
  */
 function thematic_theme_setup()
 {
     global $content_width;
     /**
      * Set the content width based on the theme's design and stylesheet.
      *
      * Used to set the width of images and content. Should be equal to the width the theme
      * is designed for, generally via the style.css stylesheet.
      *
      * @since 1.0.0
      */
     if (!isset($content_width)) {
         $content_width = 600;
     }
     // Check for MultiSite
     define('THEMATIC_MB', is_multisite());
     // Create the feedlinks
     if (!current_theme_supports('thematic_legacy_feedlinks')) {
         add_theme_support('automatic-feed-links');
     }
     if (apply_filters('thematic_post_thumbs', true)) {
         add_theme_support('post-thumbnails');
     }
     add_theme_support('thematic_superfish');
     // Path constants
     define('THEMATIC_LIB', get_template_directory() . '/library');
     // Create Theme Options Page
     require_once THEMATIC_LIB . '/extensions/theme-options.php';
     // Need a little help from our helper functions
     require_once THEMATIC_LIB . '/extensions/helpers.php';
     // Load legacy functions
     require_once THEMATIC_LIB . '/legacy/deprecated.php';
     // Load overrides to activate the old xhtml markup if set
     if (!is_admin() && thematic_is_legacy_xhtml()) {
         require_once THEMATIC_LIB . '/legacy/legacy.php';
     }
     // Add functionality only when not using old xhtml markup
     if (!thematic_is_legacy_xhtml()) {
         add_theme_support('thematic_meta_viewport');
         add_theme_support('thematic_customizer_layout');
     }
     // Load widgets
     require_once THEMATIC_LIB . '/extensions/widgets.php';
     // Load custom header extensions
     require_once THEMATIC_LIB . '/extensions/header-extensions.php';
     // Load custom content filters
     require_once THEMATIC_LIB . '/extensions/content-extensions.php';
     // Load custom Comments filters
     require_once THEMATIC_LIB . '/extensions/comments-extensions.php';
     // Load custom discussion filters
     require_once THEMATIC_LIB . '/extensions/discussion-extensions.php';
     // Load custom Widgets
     require_once THEMATIC_LIB . '/extensions/widgets-extensions.php';
     // Load the Comments Template functions and callbacks
     require_once THEMATIC_LIB . '/extensions/discussion.php';
     // Load custom sidebar hooks
     require_once THEMATIC_LIB . '/extensions/sidebar-extensions.php';
     // Load custom footer hooks
     require_once THEMATIC_LIB . '/extensions/footer-extensions.php';
     // Add Dynamic Contextual Semantic Classes
     require_once THEMATIC_LIB . '/extensions/dynamic-classes.php';
     // Load shortcodes
     require_once THEMATIC_LIB . '/extensions/shortcodes.php';
     // Load Theme Customizer support
     require_once THEMATIC_LIB . '/extensions/customizer.php';
     // Adds filters for the description/meta content in archive templates
     add_filter('archive_meta', 'wptexturize');
     add_filter('archive_meta', 'convert_smilies');
     add_filter('archive_meta', 'convert_chars');
     add_filter('archive_meta', 'wpautop');
     // Remove the WordPress Generator - via http://blog.ftwr.co.uk/archives/2007/10/06/improving-the-wordpress-generator/
     function thematic_remove_generators()
     {
         return '';
     }
     if (apply_filters('thematic_hide_generators', true)) {
         add_filter('the_generator', 'thematic_remove_generators');
     }
     // Translate, if applicable
     load_theme_textdomain('thematic', THEMATIC_LIB . '/languages');
     $locale = get_locale();
     $locale_file = THEMATIC_LIB . "/languages/{$locale}.php";
     if (is_readable($locale_file)) {
         require_once $locale_file;
     }
 }