Exemple #1
0
/**
 * Overwrites the default widths for embeds.  This is especially useful for making sure videos properly
 * expand the full width on video pages.  This function overwrites what the $content_width variable handles
 * with context-based widths.
 *
 * @since 0.1.0
 */
function trending_embed_defaults($args)
{
    $args['width'] = 600;
    if (current_theme_supports('theme-layouts')) {
        $layout = theme_layouts_get_layout();
        if ('layout-3c-l' == $layout || 'layout-3c-r' == $layout || 'layout-3c-c' == $layout) {
            $args['width'] = 470;
        } elseif ('layout-1c' == $layout) {
            $args['width'] = 950;
        }
    }
    return $args;
}
Exemple #2
0
/**
 * @since 0.1.0
 * @deprecated 0.2.0 Use theme_layouts_get_layout().
 */
function post_layouts_get_layout()
{
    return theme_layouts_get_layout();
}
Exemple #3
0
/**
 * Disables sidebars if viewing a one-column page.
 *
 * @since 0.1.0
 * @param array $sidebars_widgets A multidimensional array of sidebars and widgets.
 * @return array $sidebars_widgets
 */
function spine2_disable_sidebars($sidebars_widgets)
{
    global $wp_query, $wp_customize;
    if (current_theme_supports('theme-layouts') && !is_admin()) {
        if (!isset($wp_customize)) {
            if ('layout-2c-r' == theme_layouts_get_layout() || 'layout-2c-l' == theme_layouts_get_layout()) {
                $sidebars_widgets['secondary'] = false;
            }
        }
    }
    return $sidebars_widgets;
}
Exemple #4
0
/**
 * Overwrites the default widths for embeds.  This is especially useful for making sure videos properly
 * expand the full width on video pages.  This function overwrites what the $content_width variable handles
 * with context-based widths.
 *
 * @since 0.1.0
 * @access public
 * @param array $args Default embed arguments.
 * @return array
 */
function clea_base_embed_defaults($args)
{
    $args['width'] = 620;
    if (current_theme_supports('theme-layouts')) {
        $layout = theme_layouts_get_layout();
        if ('layout-3c-l' == $layout || 'layout-3c-r' == $layout || 'layout-3c-c' == $layout) {
            $args['width'] = 500;
        } elseif ('layout-1c' == $layout) {
            $args['width'] = 980;
        }
    }
    return $args;
}
/**
 * Determines the theme layout and active sidebars, and prints the HTML structure
 * with appropriate grid classes depending on which are activated.
 *
 * @uses alienship_sidebar_class()
 * @param string $prefix Prefix of the widget to be displayed. Example: "footer" for footer-1, footer-2, etc.
 */
function alienship_do_sidebar($prefix = false)
{
    if (!$prefix) {
        _doing_it_wrong(__FUNCTION__, __('You must specify a prefix when using alienship_do_sidebar.', 'alienship'), '1.0');
    }
    if (current_theme_supports('theme-layouts') && 'layout-1c' !== theme_layouts_get_layout() || 'footer' == $prefix || !current_theme_supports('theme-layouts')) {
        // Get our grid class
        $sidebar_class = alienship_sidebar_class($prefix);
        if ($sidebar_class) {
            ?>

			<div class="<?php 
            echo esc_attr($prefix);
            ?>
-sidebar-row row widget-area">
				<?php 
            if (is_active_sidebar(esc_attr($prefix) . '-1')) {
                ?>
					<aside id="<?php 
                echo esc_attr($prefix);
                ?>
-sidebar-1" class="sidebar widget<?php 
                echo esc_attr($sidebar_class);
                ?>
">
						<?php 
                dynamic_sidebar(esc_attr($prefix) . '-1');
                ?>
					</aside>
				<?php 
            }
            if (is_active_sidebar(esc_attr($prefix) . '-2')) {
                ?>
					<aside id="<?php 
                echo esc_attr($prefix);
                ?>
-sidebar-2" class="sidebar widget<?php 
                echo esc_attr($sidebar_class);
                ?>
">
						<?php 
                dynamic_sidebar(esc_attr($prefix) . '-2');
                ?>
					</aside>
				<?php 
            }
            if (is_active_sidebar(esc_attr($prefix) . '-3')) {
                ?>
					<aside id="<?php 
                echo esc_attr($prefix);
                ?>
-sidebar-3" class="sidebar widget<?php 
                echo esc_attr($sidebar_class);
                ?>
">
						<?php 
                dynamic_sidebar(esc_attr($prefix) . '-3');
                ?>
					</aside>
				<?php 
            }
            if (is_active_sidebar(esc_attr($prefix) . '-4')) {
                ?>
					<aside id="<?php 
                echo esc_attr($prefix);
                ?>
-sidebar-4" class="sidebar widget<?php 
                echo esc_attr($sidebar_class);
                ?>
">
						<?php 
                dynamic_sidebar(esc_attr($prefix) . '-4');
                ?>
					</aside>
				<?php 
            }
            ?>
			</div><!-- .row -->

		<?php 
        }
        //$sidebar_class
    }
    //current_theme_supports
}
Exemple #6
0
<?php

/**
 * The Sidebar containing the main widget areas.
 *
 * @package Alien Ship
 */
if (current_theme_supports('theme-layouts') && 'layout-1c' !== theme_layouts_get_layout() || !current_theme_supports('theme-layouts')) {
    if (is_active_sidebar('sidebar-1')) {
        ?>
	<div id="secondary" class="col-md-4">
		<div id="sidebar" class="widget-area" role="complementary">
			<?php 
        dynamic_sidebar('sidebar-1');
        ?>
		</div><!-- #sidebar -->
	</div><!-- #secondary -->
	<?php 
    }
}
/**
 * Overwrites the default widths for embeds.  This is especially useful for making sure videos properly
 * expand the full width on video pages.  This function overwrites what the $content_width variable handles
 * with context-based widths.
 *
 * @uses hybrid_get_content_width()
 * @uses hybrid_set_content_width()
 * @uses theme_layouts_get_layout()
 * @param array $args Array with default embed settings
 * @since Cakifo 1.3
 */
function cakifo_content_width($args)
{
    $args['width'] = hybrid_get_content_width();
    if (current_theme_supports('theme-layouts')) {
        $layout = theme_layouts_get_layout();
        if ('layout-3c-l' == $layout || 'layout-3c-r' == $layout) {
            $args['width'] = 490;
        } elseif ('layout-3c-c' == $layout) {
            $args['width'] = 500;
        } elseif ('layout-1c' == $layout) {
            $args['width'] = 940;
        }
        /* Set $content_width */
        hybrid_set_content_width($args['width']);
    }
    return $args;
}
/**
 * Overwrites the default widths for embeds.  This is especially useful for making sure videos properly
 * expand the full width on video pages.  This function overwrites what the $content_width variable handles
 * with context-based widths.
 *
 * @since 0.1.0
 */
function prototype_embed_defaults($args)
{
    if (current_theme_supports('theme-layouts')) {
        $layout = theme_layouts_get_layout();
        if ('layout-3c-l' == $layout || 'layout-3c-r' == $layout || 'layout-3c-c' == $layout) {
            $args['width'] = 500;
        } elseif ('layout-1c' == $layout) {
            $args['width'] = 928;
        } else {
            $args['width'] = 600;
        }
    } else {
        $args['width'] = 600;
    }
    return $args;
}
Exemple #9
0
/**
 * Disables sidebars if viewing a one-column page.
 *
 * @since 1.0
 * @param array $sidebars_widgets A multidimensional array of sidebars and widgets.
 * @return array $sidebars_widgets
 */
function ltheme_disable_sidebars($sidebars_widgets)
{
    global $wp_query;
    if (current_theme_supports('theme-layouts') && !is_admin()) {
        if ('layout-1c' == theme_layouts_get_layout()) {
            $sidebars_widgets['primary'] = false;
        }
    }
    return $sidebars_widgets;
}