示例#1
0
文件: functions.php 项目: fovoc/make
 /**
  * Set the content width based on current layout
  *
  * @since  1.0.0.
  *
  * @return void
  */
 function ttfmake_content_width()
 {
     global $content_width;
     $new_width = $content_width;
     $left = ttfmake_has_sidebar('left');
     $right = ttfmake_has_sidebar('right');
     // No sidebars
     if (!$left && !$right) {
         $new_width = 960;
     } else {
         if ($left && $right) {
             $new_width = 464;
         } else {
             if ($left || $right) {
                 $new_width = 620;
             }
         }
     }
     /**
      * Filter to modify the $content_width variable.
      *
      * @since 1.4.8
      *
      * @param int     $new_width    The new content width.
      * @param bool    $left         True if the current view has a left sidebar.
      * @param bool    $right        True if the current view has a right sidebar.
      */
     $content_width = apply_filters('make_content_width', $new_width, $left, $right);
 }
 /**
  * Adds custom classes to the array of body classes.
  *
  * @since  1.0.0.
  *
  * @param  array    $classes    Classes for the body element.
  * @return array                Modified class list.
  */
 function ttfmake_body_classes($classes)
 {
     // Left Sidebar
     if (true === ttfmake_has_sidebar('left')) {
         $classes[] = 'has-left-sidebar';
     }
     // Right Sidebar
     if (true === ttfmake_has_sidebar('right')) {
         $classes[] = 'has-right-sidebar';
     }
     return $classes;
 }
示例#3
0
 /**
  * Set the content width based on current layout
  *
  * @since  1.0.0.
  *
  * @return void
  */
 function ttfmake_content_width()
 {
     global $content_width;
     $left = ttfmake_has_sidebar('left');
     $right = ttfmake_has_sidebar('right');
     // No sidebars
     if (!$left && !$right) {
         $content_width = 960;
     } else {
         if ($left && $right) {
             $content_width = 464;
         } else {
             if ($left || $right) {
                 $content_width = 620;
             }
         }
     }
 }
示例#4
0
文件: extras.php 项目: jalex403/make
 /**
  * Adds custom classes to the array of body classes.
  *
  * @since  1.0.0.
  *
  * @param  array    $classes    Classes for the body element.
  * @return array                Modified class list.
  */
 function ttfmake_body_classes($classes)
 {
     // Full-width vs Boxed
     $classes[] = get_theme_mod('general-layout', ttfmake_get_default('general-layout'));
     // Header branding position
     if ('right' === get_theme_mod('header-branding-position', ttfmake_get_default('header-branding-position'))) {
         $classes[] = 'branding-right';
     }
     // Header Bar text position
     if ('flipped' === get_theme_mod('header-bar-content-layout', ttfmake_get_default('header-bar-content-layout'))) {
         $classes[] = 'header-bar-flipped';
     }
     // Left Sidebar
     if (true === ttfmake_has_sidebar('left')) {
         $classes[] = 'has-left-sidebar';
     }
     // Right Sidebar
     if (true === ttfmake_has_sidebar('right')) {
         $classes[] = 'has-right-sidebar';
     }
     return $classes;
 }
示例#5
0
 /**
  * Output the sidebar markup if the current view calls for it.
  *
  * The function is a wrapper for the get_sidebar() function. In this theme, the sidebars can be turned on and off for
  * different page views. It is important the the sidebar is *only included* if the user has set the option for it to
  * be included. As such, the get_sidebar() function needs to additional logic to determine whether or not to even
  * include the template.
  *
  * @since  1.0.0.
  *
  * @param  string    $location    The sidebar location (e.g., left, right).
  * @return void
  */
 function ttfmake_maybe_show_sidebar($location)
 {
     // Get sidebar status
     $show_sidebar = ttfmake_has_sidebar($location);
     // Output the sidebar
     if (true === $show_sidebar) {
         get_sidebar($location);
     }
 }