本文整理汇总了PHP中genesis_site_layout函数的典型用法代码示例。如果您正苦于以下问题:PHP genesis_site_layout函数的具体用法?PHP genesis_site_layout怎么用?PHP genesis_site_layout使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了genesis_site_layout函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: utility_pro_skip_links
/**
* Add skiplinks for screen readers and keyboard navigation
*
* @since 1.0.0
*/
function utility_pro_skip_links()
{
// Call function to add IDs to the markup
utility_skiplinks_markup();
// write HTML, skiplinks in a list with a heading
echo '<h2 class="screen-reader-text">' . __('Skip links', 'utility-pro') . '</h2>' . "\n";
echo '<ul class="wpacc-genesis-skip-link">' . "\n";
if (has_nav_menu('primary')) {
echo ' <li><a href="#genwpacc-genesis-nav-primary" class="screen-reader-shortcut">' . __('Skip to primary navigation', 'utility-pro') . '</a></li>' . "\n";
}
echo ' <li><a href="#genwpacc-genesis-content" class="screen-reader-shortcut">' . __('Skip to content', 'utility-pro') . '</a></li>' . "\n";
if ('sidebar-content' === genesis_site_layout() || 'content-sidebar' === genesis_site_layout()) {
echo ' <li><a href="#genwpacc-sidebar-primary" class="screen-reader-shortcut">' . __('Skip to primary sidebar', 'utility-pro') . '</a></li>' . "\n";
}
if (1 == current_theme_supports('genesis-footer-widgets')) {
$footer_widgets = get_theme_support('genesis-footer-widgets');
}
if (isset($footer_widgets[0]) && is_numeric($footer_widgets[0])) {
echo ' <li><a href="#genwpacc-genesis-footer-widgets" class="screen-reader-shortcut">' . __('Skip to footer widgets', 'utility-pro') . '</a></li>' . "\n";
}
if (has_nav_menu('footer')) {
echo ' <li><a href="#genwpacc-genesis-nav-footer" class="screen-reader-shortcut">' . __('Skip to footer navigation', 'utility-pro') . '</a></li>' . "\n";
}
echo '</ul>' . "\n";
}
示例2: bfg_layout_options_modify_classes_to_add
function bfg_layout_options_modify_classes_to_add($classes_to_add)
{
$layout = genesis_site_layout();
// content-sidebar // default
// full-width-content // supported
if ('full-width-content' === $layout) {
$classes_to_add['content'] = 'col-sm-12';
}
// sidebar-content // supported
if ('sidebar-content' === $layout) {
$classes_to_add['content'] = 'col-sm-8 col-sm-push-4';
$classes_to_add['sidebar-primary'] = 'col-sm-4 col-sm-pull-8';
}
// content-sidebar-sidebar // supported
if ('content-sidebar-sidebar' === $layout) {
$classes_to_add['content'] = 'col-sm-6';
$classes_to_add['sidebar-primary'] = 'col-sm-4';
$classes_to_add['sidebar-secondary'] = 'col-sm-2';
}
// sidebar-sidebar-content // supported
if ('sidebar-sidebar-content' === $layout) {
$classes_to_add['content'] = 'col-sm-6 col-sm-push-6';
$classes_to_add['sidebar-primary'] = 'col-sm-4 col-sm-pull-4';
$classes_to_add['sidebar-secondary'] = 'col-sm-2 col-sm-pull-10';
}
// sidebar-content-sidebar // supported
if ('sidebar-content-sidebar' === $layout) {
$classes_to_add['content'] = 'col-sm-6 col-sm-push-2';
$classes_to_add['sidebar-primary'] = 'col-sm-4 col-sm-push-2';
$classes_to_add['sidebar-secondary'] = 'col-sm-2 col-sm-pull-10';
}
return $classes_to_add;
}
示例3: mcg_layout_options_modify_classes_to_add
function mcg_layout_options_modify_classes_to_add($classes_to_add)
{
$layout = genesis_site_layout();
// content-sidebar // default
// full-width-content // supported
if ('full-width-content' === $layout) {
$classes_to_add['content'] = 'col s12';
}
// sidebar-content // supported
if ('sidebar-content' === $layout) {
$classes_to_add['content'] = 'col s12 m8 right';
$classes_to_add['sidebar-primary'] = 'col s12 m4 left';
}
// content-sidebar-sidebar // supported
if ('content-sidebar-sidebar' === $layout) {
$classes_to_add['content'] = 'col s12 m6';
$classes_to_add['sidebar-primary'] = 'col s12 m4';
$classes_to_add['sidebar-secondary'] = 'col s12 m2';
}
// sidebar-sidebar-content // supported
if ('sidebar-sidebar-content' === $layout) {
$classes_to_add['content'] = 'col s12 m6 right';
$classes_to_add['sidebar-primary'] = 'col s12 m4 right';
$classes_to_add['sidebar-secondary'] = 'col s12 m2 left';
}
// sidebar-content-sidebar // supported
if ('sidebar-content-sidebar' === $layout) {
$classes_to_add['content'] = 'col s12 m6';
$classes_to_add['sidebar-primary'] = 'col s12 m4';
$classes_to_add['sidebar-secondary'] = 'col s12 m2';
}
return $classes_to_add;
}
示例4: bsg_layout_options_modify_classes_to_add
function bsg_layout_options_modify_classes_to_add($classes_to_add)
{
$layout = genesis_site_layout();
// content-sidebar // default
// full-width-content // supported
if ('full-width-content' === $layout) {
$classes_to_add['content'] = 'col-sm-12';
}
// sidebar-content // supported
if ('sidebar-content' === $layout) {
$classes_to_add['content'] = 'col-sm-9 col-sm-push-3';
$classes_to_add['sidebar-primary'] = 'col-sm-3 col-sm-pull-9';
}
// content-sidebar-sidebar // supported
/* if ( 'content-sidebar-sidebar' === $layout ) {
$classes_to_add['content'] = 'col-sm-6';
$classes_to_add['sidebar-primary'] = 'col-sm-3';
$classes_to_add['sidebar-secondary'] = 'col-sm-3';
}*/
// sidebar-sidebar-content // supported
/* if ( 'sidebar-sidebar-content' === $layout ) {
$classes_to_add['content'] = 'col-sm-6 col-sm-push-6';
$classes_to_add['sidebar-primary'] = 'col-sm-3 col-sm-pull-3';
$classes_to_add['sidebar-secondary'] = 'col-sm-3 col-sm-pull-9';
}*/
// sidebar-content-sidebar // supported
/*if ( 'sidebar-content-sidebar' === $layout ) {
$classes_to_add['content'] = 'col-sm-6 col-sm-push-3';
$classes_to_add['sidebar-primary'] = 'col-sm-3 col-sm-push-3';
$classes_to_add['sidebar-secondary'] = 'col-sm-3 col-sm-pull-9';
}*/
return $classes_to_add;
}
示例5: bsg_layouts_modify_classes
function bsg_layouts_modify_classes($classes_to_add)
{
$layout = genesis_site_layout();
// full-width-content
if ('full-width-content' === $layout) {
$classes_to_add['content'] = 'col-sm-12';
}
// sidebar-content
if ('sidebar-content' === $layout) {
$classes_to_add['content'] = 'col-xs-12 col-sm-8 col-md-8 col-lg-7 col-sm-push-4 col-lg-push-4';
$classes_to_add['sidebar-primary'] = 'hidden-xs col-sm-4 col-md-4 col-lg-3 col-sm-pull-8 col-lg-pull-6';
}
// content-sidebar-sidebar
if ('content-sidebar-sidebar' === $layout) {
$classes_to_add['content'] = 'col-xs-12 col-sm-8 col-md-6';
$classes_to_add['sidebar-primary'] = 'hidden-xs col-sm-4 col-md-3';
$classes_to_add['sidebar-secondary'] = 'hidden-xs hidden-sm col-md-3';
}
// sidebar-sidebar-content
if ('sidebar-sidebar-content' === $layout) {
$classes_to_add['content'] = 'col-xs-12 col-sm-8 col-sm-push-4 col-md-6 col-md-push-6';
$classes_to_add['sidebar-primary'] = 'hidden-xs col-sm-4 col-sm-pull-8 col-md-3 col-md-pull-3';
$classes_to_add['sidebar-secondary'] = 'hidden-xs hidden-sm col-md-3 col-md-pull-9';
}
// sidebar-content-sidebar
if ('sidebar-content-sidebar' === $layout) {
$classes_to_add['content'] = 'col-xs-12 col-sm-8 col-md-6 col-md-push-3';
$classes_to_add['sidebar-primary'] = 'hidden-xs col-sm-4 col-md-3 col-md-pull-6';
$classes_to_add['sidebar-secondary'] = 'hidden-xs hidden-sm col-md-3';
}
return $classes_to_add;
}
示例6: ldm_full_width_classes
function ldm_full_width_classes($classes_to_add, $context, $attr)
{
$layout = genesis_site_layout();
if ('full-width-content' === $layout) {
$classes_to_add['content'] = 'col-sm-12';
}
return $classes_to_add;
}
示例7: ldm_sidebar_content_markup_mod
function ldm_sidebar_content_markup_mod()
{
$layout = genesis_site_layout();
if ('sidebar-content' === $layout) {
remove_action('genesis_after_content', 'genesis_get_sidebar');
add_action('genesis_before_content', 'genesis_get_sidebar');
}
}
示例8: ldm_content_sidebar_sidebar_markup_mod
function ldm_content_sidebar_sidebar_markup_mod()
{
$layout = genesis_site_layout();
if ('content-sidebar-sidebar' === $layout) {
remove_action('genesis_after_content_sidebar_wrap', 'genesis_get_sidebar_alt');
add_action('genesis_after_content', 'genesis_get_sidebar_alt', 15);
}
}
示例9: be_no_sidebar
/**
* Custom Loop for Archive Layout
* @author Bill Erickson
* @link http://www.billerickson.net/wordpress-genesis-custom-layout/
*/
function be_no_sidebar()
{
$site_layout = genesis_site_layout();
if ('no-sidebar' == $site_layout) {
be_no_sidebar();
} else {
genesis_standard_loop();
}
}
示例10: ldm_sidebar_sidebar_content_markup_mod
function ldm_sidebar_sidebar_content_markup_mod()
{
$layout = genesis_site_layout();
if ('sidebar-sidebar-content' === $layout) {
// secondary sidebar
remove_action('genesis_after_content_sidebar_wrap', 'genesis_get_sidebar_alt');
add_action('genesis_before_content', 'genesis_get_sidebar_alt', 5);
// primary sidebar
remove_action('genesis_after_content', 'genesis_get_sidebar');
add_action('genesis_before_content', 'genesis_get_sidebar', 10);
}
}
示例11: change_sidebar_order
/**
* Swap Primary and Secondary Sidebars on Sidebar-Sidebar-Content
*
* @author Bill Erickson
* @link http://www.billerickson.net/switch-genesis-sidebars/
*/
function change_sidebar_order()
{
$site_layout = genesis_site_layout();
if ('sidebar-content-sidebar' == $site_layout) {
// Remove the Primary Sidebar from the Primary Sidebar area.
remove_action('genesis_sidebar', 'genesis_do_sidebar');
// Remove the Secondary Sidebar from the Secondary Sidebar area.
remove_action('genesis_sidebar_alt', 'genesis_do_sidebar_alt');
// Place the Secondary Sidebar into the Primary Sidebar area.
add_action('genesis_sidebar', 'genesis_do_sidebar_alt');
// Place the Primary Sidebar into the Secondary Sidebar area.
add_action('genesis_sidebar_alt', 'genesis_do_sidebar');
}
}
示例12: ssm_layout_options_modify_classes_to_add
function ssm_layout_options_modify_classes_to_add($classes_to_add)
{
$layout = genesis_site_layout();
// content-sidebar // default
// full-width-content // supported
if ('full-width-content' === $layout) {
$classes_to_add['content'] = array('small-12', 'column');
}
// sidebar-content
// - same markup as content-sidebar with css modifications rather than markup
// content-sidebar-sidebar // not yet supported
// sidebar-sidebar-content // not yet supported
// sidebar-content-sidebar // not yet supported
return $classes_to_add;
}
示例13: msdlab_bootstrap_sidebar_alt
function msdlab_bootstrap_sidebar_alt($attributes)
{
$layout = genesis_site_layout();
$template = get_page_template();
switch ($layout) {
case 'content-sidebar':
case 'sidebar-content':
$attributes['class'] .= ' row col-md-4 col-12sm';
break;
case 'content-sidebar-sidebar':
case 'sidebar-sidebar-content':
case 'sidebar-content-sidebar':
$attributes['class'] .= ' row col-md-4 col-12sm';
break;
case 'full-width-content':
$attributes['class'] .= ' hidden';
break;
}
return $attributes;
}
示例14: ygf_layout_options_modify_classes_to_add
function ygf_layout_options_modify_classes_to_add($classes_to_add)
{
$layout = genesis_site_layout();
// full-width-content // supported
// content-sidebar // default
if ('content-sidebar' === $layout) {
$classes_to_add['content'] .= ' small-12 medium-7 large-8 xlarge-9';
$classes_to_add['sidebar-primary'] .= ' small-12 medium-5 large-4 xlarge-3';
}
// sidebar-content
if ('sidebar-content' === $layout) {
$classes_to_add['content'] .= ' small-12 medium-7 medium-push-5 large-8 large-push-4 xlarge-9 xlarge-push-3';
$classes_to_add['sidebar-primary'] .= ' small-12 medium-5 medium-pull-7 large-4 large-pull-8 xlarge-3 xlarge-pull-9';
}
// content-sidebar-sidebar
if ('content-sidebar-sidebar' === $layout) {
$classes_to_add['content'] .= ' small-12 medium-4 large-6 xlarge-8';
$classes_to_add['sidebar-primary'] .= ' small-12 medium-4 large-3 xlarge-2';
$classes_to_add['sidebar-secondary'] .= ' small-12 medium-4 large-3 xlarge-2';
}
// sidebar-sidebar-content // not yet supported
if ('sidebar-sidebar-content' === $layout) {
$classes_to_add['content'] .= ' small-12 medium-4 medium-push-8 large-6 large-push-6 xlarge-8 xlarge-push-4';
$classes_to_add['sidebar-primary'] .= ' small-12 medium-4 medium-pull-4 large-3 large-pull-6 xlarge-2 xlarge-pull-8';
$classes_to_add['sidebar-secondary'] .= ' small-12 medium-4 medium-pull-4 large-3 large-pull-6 xlarge-2 xlarge-pull-8';
}
// sidebar-content-sidebar
if ('sidebar-content-sidebar' === $layout) {
$classes_to_add['content'] .= ' small-12 medium-4 medium-push-4 large-6 large-push-3 xlarge-8 xlarge-push-2';
$classes_to_add['sidebar-primary'] .= ' small-12 medium-4 medium-pull-4 large-3 large-pull-6 xlarge-2 xlarge-pull-8';
$classes_to_add['sidebar-secondary'] .= ' small-12 medium-4 large-3 xlarge-2';
}
return $classes_to_add;
}
示例15: msd_new_custom_layout_logic
function msd_new_custom_layout_logic()
{
$site_layout = genesis_site_layout();
if ($site_layout == 'sidebar-content-sidebar') {
// Remove default genesis sidebars
remove_action('genesis_after_content', 'genesis_get_sidebar');
remove_action('genesis_after_content_sidebar_wrap', 'genesis_get_sidebar_alt');
// Add layout specific sidebars
add_action('genesis_before_content_sidebar_wrap', 'genesis_get_sidebar');
add_action('genesis_after_content', 'genesis_get_sidebar_alt');
}
}