Beispiel #1
0
/**
* decide whether to enqueue sidebar or non-sidebar scripts
**/
function spring_enqueue_sidebar_script()
{
    $sidebarfile = 'spring-production-no-sidebar';
    if (spring_display_sidebar()) {
        $sidebarfile = 'spring-production';
    }
    wp_enqueue_script('spring_app', get_template_directory_uri() . '/assets/js/build/' . $sidebarfile . '.js', '', '', true);
}
Beispiel #2
0
function spring_sidebar_button()
{
    if (spring_display_sidebar()) {
        // Show sidebar button on pages where sidebar is enabled
        $sidebar_button = '<button id="openSidebar" class="open-sidebar open-button"><span>Open Sidebar</span></button>';
    } else {
        // Disable sidebar button where sidebar is disabled
        $sidebar_button = '';
    }
    return $sidebar_button;
}
Beispiel #3
0
<?php

get_template_part('templates/header');
?>
<section class="content">
	<main class="content--body <?php 
echo spring_main_class();
?>
" role="main">
	        <?php 
include spring_template_path();
?>
	</main>
    <!-- /.main -->
    <?php 
if (spring_display_sidebar()) {
    ?>
        <aside class="sidebar content--sidebar <?php 
    echo spring_sidebar_class();
    ?>
" role="complementary">
            <?php 
    include spring_sidebar_path();
    ?>
        </aside><!-- /.sidebar -->
    <?php 
}
?>
</section><!-- /.content -->