Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bootscore_container_class() function #439

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion 404.php
Expand Up @@ -10,7 +10,7 @@

get_header();
?>
<div id="content" class="site-content container py-5 mt-5">
<div id="content" class="site-content <?php echo bootscore_container_class(); ?> py-5 mt-5">
<div id="primary" class="content-area">

<main id="main" class="site-main">
Expand Down
12 changes: 6 additions & 6 deletions archive.php
Expand Up @@ -11,7 +11,7 @@
get_header();
?>

<div id="content" class="site-content container py-5 mt-5">
<div id="content" class="site-content <?php echo bootscore_container_class(); ?> py-5 mt-5">
<div id="primary" class="content-area">

<?php bs_after_primary(); ?>
Expand All @@ -28,7 +28,7 @@

<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>

<div class="card horizontal mb-4">
<div class="row g-0">

Expand All @@ -39,7 +39,7 @@
</a>
</div>
<?php endif; ?>

<div class="col">
<div class="card-body">

Expand All @@ -59,13 +59,13 @@
?>
</p>
<?php endif; ?>

<p class="card-text">
<a class="text-body text-decoration-none" href="<?php the_permalink(); ?>">
<?php echo strip_tags(get_the_excerpt()); ?>
</a>
</p>

<p class="card-text">
<a class="read-more" href="<?php the_permalink(); ?>">
<?php _e('Read more »', 'bootscore'); ?>
Expand All @@ -78,7 +78,7 @@
</div>
</div>
</div>

<?php endwhile; ?>
<?php endif; ?>

Expand Down
6 changes: 3 additions & 3 deletions footer.php
Expand Up @@ -17,7 +17,7 @@
<footer>

<div class="bootscore-footer bg-light pt-5 pb-3">
<div class="container">
<div class="<?php echo bootscore_container_class(); ?>">

<!-- Top Footer Widget -->
<?php if (is_active_sidebar('top-footer')) : ?>
Expand Down Expand Up @@ -85,7 +85,7 @@
</div>

<div class="bootscore-info bg-light text-muted border-top py-2 text-center">
<div class="container">
<div class="<?php echo bootscore_container_class(); ?>">
<small>&copy;&nbsp;<?php echo Date('Y'); ?> - <?php bloginfo('name'); ?></small>
</div>
</div>
Expand All @@ -101,4 +101,4 @@

</body>

</html>
</html>
8 changes: 4 additions & 4 deletions header-woocommerce.php
Expand Up @@ -8,7 +8,7 @@
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package Bootscore
*
*
* @version 5.2.3.1
*/

Expand Down Expand Up @@ -43,7 +43,7 @@

<nav id="nav-main" class="navbar navbar-expand-lg">

<div class="container">
<div class="<?php echo bootscore_container_class(); ?>">

<!-- Navbar Brand -->
<a class="navbar-brand xs d-md-none" href="<?php echo esc_url(home_url()); ?>"><img src="<?php echo esc_url(get_stylesheet_directory_uri()); ?>/img/logo/logo-sm.svg" alt="logo" class="logo xs"></a>
Expand Down Expand Up @@ -115,12 +115,12 @@

</div><!-- .header-actions -->

</div><!-- .container -->
</div><!-- .<?php echo bootscore_container_class(); ?> -->

</nav><!-- .navbar -->

<!-- Top Nav Search Collapse -->
<div class="collapse container" id="collapse-search">
<div class="collapse <?php echo bootscore_container_class(); ?>" id="collapse-search">
<?php if (is_active_sidebar('top-nav-search')) : ?>
<div class="mb-2">
<?php dynamic_sidebar('top-nav-search'); ?>
Expand Down
10 changes: 5 additions & 5 deletions header.php
Expand Up @@ -8,7 +8,7 @@
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package Bootscore
*
*
* @version 5.2.0.0
*/

Expand Down Expand Up @@ -43,7 +43,7 @@

<nav id="nav-main" class="navbar navbar-expand-lg">

<div class="container">
<div class="<?php echo bootscore_container_class(); ?>">

<!-- Navbar Brand -->
<a class="navbar-brand xs d-md-none" href="<?php echo esc_url(home_url()); ?>"><img src="<?php echo esc_url(get_stylesheet_directory_uri()); ?>/img/logo/logo-sm.svg" alt="logo" class="logo xs"></a>
Expand Down Expand Up @@ -105,12 +105,12 @@

</div><!-- .header-actions -->

</div><!-- .container -->
</div><!-- .<?php echo bootscore_container_class(); ?> -->

</nav><!-- .navbar -->

<!-- Top Nav Search Mobile Collapse -->
<div class="collapse container d-lg-none" id="collapse-search">
<div class="collapse <?php echo bootscore_container_class(); ?> d-lg-none" id="collapse-search">
<?php if (is_active_sidebar('top-nav-search')) : ?>
<div class="mb-2">
<?php dynamic_sidebar('top-nav-search'); ?>
Expand All @@ -120,4 +120,4 @@

</div><!-- .fixed-top .bg-light -->

</header><!-- #masthead -->
</header><!-- #masthead -->
11 changes: 11 additions & 0 deletions inc/template-functions.php
Expand Up @@ -36,3 +36,14 @@ function bootscore_pingback_header() {
}
}
add_action('wp_head', 'bootscore_pingback_header');


/**
* Allow modifying the default bootstrap container class
* @return string
*/
if( ! function_exists('bootscore_container_class') ) {
function bootscore_container_class() {
return "container";
}
}
20 changes: 10 additions & 10 deletions index.php
Expand Up @@ -15,7 +15,7 @@

get_header();
?>
<div id="content" class="site-content container py-5 mt-4">
<div id="content" class="site-content <?php echo bootscore_container_class(); ?> py-5 mt-4">
<div id="primary" class="content-area">

<!-- Hook to add something nice -->
Expand Down Expand Up @@ -43,10 +43,10 @@
if ($the_query->have_posts()) :
while ($the_query->have_posts()) : $the_query->the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

<div class="card horizontal mb-4">
<div class="row g-0">

<?php if ( has_post_thumbnail() ) : ?>
<div class="col-lg-6 col-xl-5 col-xxl-4">
<a href="<?php the_permalink(); ?>">
Expand Down Expand Up @@ -93,14 +93,14 @@
<?php _e('Read more »', 'bootscore'); ?>
</a>
</p>

<?php bootscore_tags(); ?>

</div>
</div>
</div>
</div>

</article>
<?php
endwhile;
Expand All @@ -121,7 +121,7 @@
<?php while (have_posts()) : the_post(); ?>
<?php if (is_sticky()) continue; //ignore sticky posts
?>

<div class="card horizontal mb-4">
<div class="row g-0">

Expand All @@ -132,7 +132,7 @@
</a>
</div>
<?php endif; ?>

<div class="col">
<div class="card-body">

Expand All @@ -158,20 +158,20 @@
<?php echo strip_tags(get_the_excerpt()); ?>
</a>
</p>

<p class="card-text">
<a class="read-more" href="<?php the_permalink(); ?>">
<?php _e('Read more »', 'bootscore'); ?>
</a>
</p>

<?php bootscore_tags(); ?>

</div>
</div>
</div>
</div>

<?php endwhile; ?>
<?php endif; ?>

Expand Down
4 changes: 2 additions & 2 deletions page-templates/page-blank-with-container.php
Expand Up @@ -11,7 +11,7 @@
get_header();
?>

<div id="content" class="site-content container">
<div id="content" class="site-content <?php echo bootscore_container_class(); ?>">
<div id="primary" class="content-area">

<!-- Hook to add something nice -->
Expand All @@ -30,4 +30,4 @@
</div>

<?php
get_footer();
get_footer();
6 changes: 3 additions & 3 deletions page-templates/page-full-width-image.php
Expand Up @@ -18,12 +18,12 @@

<?php $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full'); ?>
<header class="entry-header featured-full-width-img height-75 bg-dark text-light mb-3" style="background-image: url('<?php echo $thumb['0']; ?>')">
<div class="container entry-header h-100 d-flex align-items-end pb-3">
<div class="<?php echo bootscore_container_class(); ?> entry-header h-100 d-flex align-items-end pb-3">
<h1 class="entry-title"><?php the_title(); ?></h1>
</div>
</header>

<div class="container pb-5">
<div class="<?php echo bootscore_container_class(); ?> pb-5">

<!-- Hook to add something nice -->
<?php bs_after_primary(); ?>
Expand All @@ -44,4 +44,4 @@
</div>

<?php
get_footer();
get_footer();
4 changes: 2 additions & 2 deletions page-templates/page-sidebar-left.php
Expand Up @@ -11,7 +11,7 @@
get_header();
?>

<div id="content" class="site-content container py-5 mt-5">
<div id="content" class="site-content <?php echo bootscore_container_class(); ?> py-5 mt-5">
<div id="primary" class="content-area">

<!-- Hook to add something nice -->
Expand Down Expand Up @@ -46,4 +46,4 @@
</div>

<?php
get_footer();
get_footer();
4 changes: 2 additions & 2 deletions page-templates/page-sidebar-none.php
Expand Up @@ -11,7 +11,7 @@
get_header();
?>

<div id="content" class="site-content container py-5 mt-5">
<div id="content" class="site-content <?php echo bootscore_container_class(); ?> py-5 mt-5">
<div id="primary" class="content-area">

<!-- Hook to add something nice -->
Expand Down Expand Up @@ -39,4 +39,4 @@
</div>

<?php
get_footer();
get_footer();
4 changes: 2 additions & 2 deletions page.php
Expand Up @@ -16,7 +16,7 @@
get_header();
?>

<div id="content" class="site-content container py-5 mt-5">
<div id="content" class="site-content <?php echo bootscore_container_class(); ?> py-5 mt-5">
<div id="primary" class="content-area">

<!-- Hook to add something nice -->
Expand Down Expand Up @@ -51,4 +51,4 @@
</div>

<?php
get_footer();
get_footer();
2 changes: 1 addition & 1 deletion search.php
Expand Up @@ -10,7 +10,7 @@

get_header();
?>
<div id="content" class="site-content container py-5 mt-5">
<div id="content" class="site-content <?php echo bootscore_container_class(); ?> py-5 mt-5">
<div id="primary" class="content-area">

<!-- Hook to add something nice -->
Expand Down
8 changes: 4 additions & 4 deletions single-templates/single-full-width-image.php
Expand Up @@ -4,7 +4,7 @@
* Template Post Type: post
*/

get_header();
get_header();
?>

<div id="content" class="site-content">
Expand All @@ -15,12 +15,12 @@
<?php the_post(); ?>
<?php $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full'); ?>
<header class="entry-header featured-full-width-img height-75 bg-dark text-light mb-3" style="background-image: url('<?php echo $thumb['0']; ?>')">
<div class="container entry-header h-100 d-flex align-items-end pb-3">
<div class="<?php echo bootscore_container_class(); ?> entry-header h-100 d-flex align-items-end pb-3">
<h1 class="entry-title"><?php the_title(); ?></h1>
</div>
</header>

<div class="container pb-5">
<div class="<?php echo bootscore_container_class(); ?> pb-5">

<!-- Hook to add something nice -->
<?php bs_after_primary(); ?>
Expand Down Expand Up @@ -66,4 +66,4 @@
</div>

<?php
get_footer();
get_footer();