Compare commits

..

10 Commits

8 changed files with 476 additions and 25 deletions

View File

@@ -2,31 +2,31 @@ jQuery(function ($) {
// Getting links from a page and turning them into a scroll-spy bespoke menu // Getting links from a page and turning them into a scroll-spy bespoke menu
// FIXME when page loads with #... in url, the scroll spy gets messed up.
let links; let sections;
sections = document.querySelectorAll(".add-to-sidebar")
links = document.querySelectorAll("#one, #two, #three, #four, #fivenav_menu-7")
let url = window.location.href; let url = window.location.href;
// Create the correct menu
let innerContent = ""; let innerContent = "";
sections.forEach(link => {
links.forEach(link => { let itemTitle = link.querySelector("h2:first-of-type, h3:first-of-type, h4:first-of-type, h5:first-of-type, h6:first-of-type");
let fullUrl = url + "#" + link.id; if (itemTitle) {
innerContent += "<li><a href=\"" + fullUrl + " \" class=''>" + link.attributes.name.value + "</a></li>" link.setAttribute("id", itemTitle.innerText.replace(/\W/g,'_'))
let fullUrl = url.split("#")[0] + "#" + itemTitle.innerText.replace(/\W/g,'_');
innerContent += "<li><a href=\"" + fullUrl + " \" class=''>" + itemTitle.innerText + "</a></li>"
}
}); });
console.log(innerContent) // Update existing menu with the created one
let menu; let menu;
menu = document.getElementById("menu-scroll-spy"); menu = document.getElementById("menu-scroll-spy");
menu.innerHTML = innerContent menu.innerHTML = innerContent
// Activate Scrollspy // Activate Scrollspy
$('.entry-content').scrollspy({ $('body').scrollspy({
target: '#nav_menu-4' target: '#nav_menu-4'
}); });
@@ -38,17 +38,14 @@ jQuery(function ($) {
$('[data-spy="scroll"]').each(function () { $('[data-spy="scroll"]').each(function () {
$(this).scrollspy("refresh"); $(this).scrollspy("refresh");
}); });
});
});
document.addEventListener("DOMContentLoaded", function(event) { document.addEventListener("DOMContentLoaded", function(event) {
var elements = document.querySelectorAll('.view-team-member-button'); var elements = document.querySelectorAll('.view-team-member-button');
elements.forEach(function(element) {
elements.forEach(function(element) {
element.addEventListener('click', function() { element.addEventListener('click', function() {
for (elem of document.getElementsByClassName("view-team-member-bio")) { for (elem of document.getElementsByClassName("view-team-member-bio")) {

View File

@@ -21,11 +21,31 @@
} }
} }
/* Is required to show the svg logo */ /* Is required to show the svg logo */
.navbar-brand { .navbar-brand {
width: 150px; width: 150px;
} }
.offcanvas-body #bootscore-navbar {
li {
border-top: 1px dotted #fff;
padding: 0.5rem 0;
&:last-of-type {
border-bottom: 1px dotted #fff;
}
}
}
@include media-breakpoint-up(lg) {
.offcanvas-body #bootscore-navbar {
li,
li:last-of-type {
border-color: transparent;
}
}
}
/* CUSTOM BLOCK MOBILE SUPPORT */ /* CUSTOM BLOCK MOBILE SUPPORT */
@include media-breakpoint-up(md) { @include media-breakpoint-up(md) {
@@ -91,6 +111,20 @@
} }
} }
.is-home-featured-image {
height: 600px;
}
.is-home-featured-image img {
background-repeat: no-repeat !important;
width: auto !important;
height: 600px !important;
display: flex !important;
justify-content: end !important;
align-items: center !important;
}
/* Footer */ /* Footer */
#footer { #footer {
@@ -181,6 +215,7 @@
#sidebar { #sidebar {
// padding-left: 8rem; // padding-left: 8rem;
// padding-right: 2rem; // padding-right: 2rem;
top: 30px;
font-size: 24px; font-size: 24px;
position: sticky; position: sticky;
a:not(.active) { a:not(.active) {
@@ -188,7 +223,6 @@
} }
li { li {
border-top: 1px dotted #000; border-top: 1px dotted #000;
// border-bottom:
padding: 0.5rem 0; padding: 0.5rem 0;
&:last-of-type { &:last-of-type {
border-bottom: 1px dotted #000; border-bottom: 1px dotted #000;
@@ -219,6 +253,7 @@ body:not(.wp-admin) .wp-block-group.team {
div.team-member-wrapper { div.team-member-wrapper {
// Ensure each item is a square // Ensure each item is a square
aspect-ratio: 1/1; aspect-ratio: 1/1;
position: relative;
// Resetting height/width to ensure that team member's name covers entire square // Resetting height/width to ensure that team member's name covers entire square
.wp-block-cover, .wp-block-cover,
@@ -228,6 +263,7 @@ body:not(.wp-admin) .wp-block-group.team {
padding: 0; padding: 0;
} }
&:hover { &:hover {
cursor: pointer;
.team-member-name { .team-member-name {
visibility: visible; visibility: visible;
opacity: 1; opacity: 1;
@@ -253,6 +289,7 @@ body:not(.wp-admin) .wp-block-group.team {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 0;
} }
} }
@@ -289,11 +326,8 @@ body:not(.wp-admin) .wp-block-group.team {
.team-member-bio { .team-member-bio {
display: none; display: none;
} }
} }
@include media-breakpoint-up(sm) { @include media-breakpoint-up(sm) {
body:not(.wp-admin) .wp-block-group.team { body:not(.wp-admin) .wp-block-group.team {
grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-columns: repeat(2, minmax(0, 1fr));
@@ -392,3 +426,191 @@ body:not(.wp-admin) .wp-block-group.team {
} }
} }
.add-to-sidebar {
position: relative;
height: 100%;
}
@include media-breakpoint-down(md) {
.row > * {
padding-left: var(--wp--preset--spacing--30);
padding-right: var(--wp--preset--spacing--30);
}
.home .container {
padding: 0;
.wp-block-columns {
padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--30);
}
}
.wp-block-heading {
margin-bottom: 0 !important;
}
#nav-main {
padding-left: var(--wp--preset--spacing--30);
padding-right: var(--wp--preset--spacing--30);
}
.wp-block-columns,
.wp-block-cover {
padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--30);
gap: 10px;
}
.entry-content .wp-block-columns {
padding: 0;
}
.has-text-align-right {
// text-align: center;
}
.wp-block-columns > .wp-block-column {
padding-top: var(--wp--preset--spacing--30) !important;
padding-right: 0 !important;
padding-bottom: var(--wp--preset--spacing--30) !important;
padding-left: 0 !important;
}
.is-style-fixed-height-272,
.is-style-fixed-height-400 {
height: auto;
}
.is-style-fixed-height-400 {
min-height: 400px;
}
/* Footer */
.bootscore-footer-columns,
.bootscore-footer-info {
padding: var(--wp--preset--spacing--30);
}
#footer .container {
padding: 0;
}
}
@media only screen and (max-width: 768px) and (min-width: 388px) {
.is-home-featured-image {
.wp-block-cover__inner-container {
width: 360px;
position: absolute;
left: 0;
bottom: 0;
//padding-right: var(--wp--preset--spacing--40);
padding-bottom: var(--wp--preset--spacing--40);
span {
display: block;
font-size: 45px !important;
}
}
}
}
@media only screen and (max-width: 991px) and (min-width: 769px) {
.is-home-featured-image {
.wp-block-cover__inner-container {
width: 360px;
position: absolute;
left: 0;
bottom: 0;
//padding-right: var(--wp--preset--spacing--40);
padding-bottom: var(--wp--preset--spacing--40);
span {
display: block;
font-size: 45px !important;
}
}
}
}
@media only screen and (max-width: 1201px) and (min-width: 992px) {
.is-home-featured-image {
.wp-block-cover__inner-container {
// width: 360px;
// position: absolute;
// left: 0;
// bottom: 0;
//padding-right: var(--wp--preset--spacing--40);
padding-bottom: var(--wp--preset--spacing--40);
span {
display: block;
font-size: 45px !important;
}
}
}
}
@media only screen and (max-width: 1400px) and (min-width: 1202px) {
.is-home-featured-image {
.wp-block-cover__inner-container {
// width: 360px;
// position: absolute;
// left: 0;
// bottom: 0;
//padding-right: var(--wp--preset--spacing--40);
padding-bottom: var(--wp--preset--spacing--40);
span {
// display: block;
font-size: 50px !important;
}
}
}
.footer-crane .wp-block-cover__image-background {
background-position: 163% 14% !important;
}
}
/* Crane Image */
@media only screen and (max-width: 387px) {
.is-home-featured-image {
.wp-block-cover__inner-container {
position: absolute;
bottom: 0;
padding-right: var(--wp--preset--spacing--40);
padding-bottom: var(--wp--preset--spacing--40);
span {
display: block;
font-size: 45px !important;
}
}
}
}
@media only screen and (max-width: 452px) {
.footer-crane {
.wp-block-cover__image-background {
background-position: 50% 300px !important;
background-size: cover;
}
.wp-block-cover__inner-container {
padding-bottom: 200px;
}
}
}
@media only screen and (max-width: 768px) and (min-width: 453px) {
.footer-crane {
.wp-block-cover__image-background {
background-position: 50% 200px !important;
background-size: cover;
}
.wp-block-cover__inner-container {
padding-bottom: 200px;
}
}
}
@media only screen and (max-width: 1200px) and (min-width: 769px) {
.footer-crane {
.wp-block-cover__image-background {
background-position: -330px 10% !important;
background-size: inherit;
}
}
}

View File

@@ -65,3 +65,9 @@ $container-max-widths: (
xl: 1140px, xl: 1140px,
xxl: 1400px xxl: 1400px
); );
$offcanvas-bg-color: $primary;
$offcanvas-color: #fff;

View File

@@ -105,6 +105,17 @@ function footer_class() {
add_filter('bootscore/class/footer/columns', 'footer_class', 10, 2); add_filter('bootscore/class/footer/columns', 'footer_class', 10, 2);
/**
* Change footer column1 classes
*/
function footer_col__class() {
return "col-sm-6 col-lg-3";
}
add_filter('bootscore/class/footer/col', 'footer_col__class', 10, 2);
/** /**
* Change footer info classes * Change footer info classes
*/ */
@@ -226,7 +237,19 @@ add_action( 'init', 'register_list_block_popout' );
/** /**
* Change one or more classes into my-custom-class * Change one or more classes into my-custom-class
*/ */
function my_fancy_filter_function() { function featured_full_width_img_classes() {
return "featured-full-width-img bg-dark text-light mb-5"; return "featured-full-width-img bg-dark text-light mb-5";
} }
add_filter('bootscore/class/featured-full-width-img', 'my_fancy_filter_function', 10, 2); add_filter('bootscore/class/featured-full-width-img', 'featured_full_width_img_classes', 10, 2);
// /**
// * Change container class in a single file
// */
// function change_container_in_single_file($string, $location) {
// if ($location == 'page-sidebar-none') {
// return "container-fluid";
// }
// return $string;
// }
// add_filter('bootscore/class/container', 'change_container_in_single_file', 10, 2);

147
index.php Normal file
View File

@@ -0,0 +1,147 @@
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Bootscore
* @version 6.1.1
*/
// Exit if accessed directly
defined('ABSPATH') || exit;
get_header();
?>
<div id="content" class="site-content">
<div id="primary" class="content-area">
<?php do_action('bootscore_after_primary_open', 'index'); ?>
<main id="main" class="site-main">
<!-- Header -->
<?php
$page_for_posts = get_option( 'page_for_posts' );
$thumb = wp_get_attachment_image_src(get_post_thumbnail_id($page_for_posts), 'full');
?>
<div class="entry-header <?= apply_filters('bootscore/class/featured-full-width-img', 'featured-full-width-img bg-dark text-light mb-5', 'page-full-width-image'); ?>" style="background-image: url('<?= $thumb['0']; ?>')">
<div class="<?= apply_filters('bootscore/class/container', 'container', 'page-full-width-image'); ?> <?= apply_filters('bootscore/class/featured-full-width-img/container', 'h-100 d-flex align-items-end pb-3', 'page-full-width-image'); ?>">
<div class="<?= apply_filters('bootscore/class/full-width-img-title-wrapper', 'full-width-img-title-wrapper', 'page-full-width-image'); ?>">
<?php do_action( 'bootscore_before_title', 'page-full-width-image' ); ?>
<h1 class="entry-title"><?php echo get_the_title($page_for_posts)?></h1>
<?php do_action( 'bootscore_after_title', 'page-full-width-image' ); ?>
</div>
</div>
</div>
<div class="container">
<!-- Post List -->
<div class="row">
<div class="col">
<?php do_action( 'bootscore_before_loop', 'index' ); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php do_action( 'bootscore_before_loop_item', 'index' ); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( apply_filters('bootscore/class/loop/card', 'card horizontal mb-4', 'index') ); ?>>
<div class="<?= apply_filters('bootscore/class/loop/card/row', 'row g-0', 'index'); ?>">
<?php if (has_post_thumbnail()) : ?>
<div class="<?= apply_filters('bootscore/class/loop/card/image/col', 'col-lg-6 col-xl-5 col-xxl-4', 'index'); ?>">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail('medium', array('class' => apply_filters('bootscore/class/loop/card/image', 'card-img-lg-start', 'index'))); ?>
</a>
</div>
<?php endif; ?>
<div class="<?= apply_filters('bootscore/class/loop/card/content/col', 'col', 'index'); ?>">
<div class="<?= apply_filters('bootscore/class/loop/card/body', 'card-body', 'index'); ?>">
<div class="d-flex justify-content-between gap-3">
<?php if (apply_filters('bootscore/loop/category', true, 'index')) : ?>
<?php bootscore_category_badge(); ?>
<?php endif; ?>
<?php if (is_sticky() ) { ?>
<p class="sticky-badge"><span class="badge text-bg-danger"><?= apply_filters('bootscore/icon/star', '<i class="fa-solid fa-star"></i>'); ?></span></p>
<?php } ?>
</div>
<?php do_action('bootscore_before_loop_title', 'index'); ?>
<a class="text-body text-decoration-none" href="<?php the_permalink(); ?>">
<?php the_title('<h2 class="' . apply_filters('bootscore/class/loop/card/title', 'blog-post-title h5', 'index') . '">', '</h2>'); ?>
</a>
<?php if (apply_filters('bootscore/loop/meta', true, 'index')) : ?>
<?php if ('post' === get_post_type()) : ?>
<p class="meta small mb-2 text-body-secondary">
<?php
bootscore_date();
bootscore_author();
bootscore_comments();
bootscore_edit();
?>
</p>
<?php endif; ?>
<?php endif; ?>
<?php if (apply_filters('bootscore/loop/excerpt', true, 'index')) : ?>
<p class="<?= apply_filters('bootscore/class/loop/card-text/excerpt', 'card-text', 'index'); ?>">
<a class="text-body text-decoration-none" href="<?php the_permalink(); ?>">
<?= strip_tags(get_the_excerpt()); ?>
</a>
</p>
<?php endif; ?>
<?php if (apply_filters('bootscore/loop/read-more', true, 'index')) : ?>
<p class="<?= apply_filters('bootscore/class/loop/card-text/read-more', 'card-text', 'index'); ?>">
<a class="<?= apply_filters('bootscore/class/loop/read-more', 'read-more', 'index'); ?>" href="<?php the_permalink(); ?>">
<?= apply_filters('bootscore/loop/read-more/text', __('Read more »', 'bootscore', 'index')); ?>
</a>
</p>
<?php endif; ?>
<?php if (apply_filters('bootscore/loop/tags', true, 'index')) : ?>
<?php bootscore_tags(); ?>
<?php endif; ?>
</div>
<?php do_action('bootscore_loop_item_after_card_body', 'index'); ?>
</div><!-- col -->
</div><!-- row -->
</article><!-- article -->
<?php do_action('bootscore_after_loop_item', 'index'); ?>
<?php endwhile; ?>
<?php endif; ?>
<?php do_action('bootscore_after_loop', 'index'); ?>
<div class="entry-footer">
<?php bootscore_pagination(); ?>
</div>
</div><!-- col -->
</div><!-- row -->
</div><!-- container -->
</main><!-- #main -->
</div><!-- #primary -->
</div><!-- #content -->
<?php
get_footer();

View File

@@ -0,0 +1,56 @@
<?php
/**
* Template Name: No Sidebar
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Bootscore
* @version 6.1.0
*/
// Exit if accessed directly
defined('ABSPATH') || exit;
get_header();
?>
<div id="content" class="site-content">
<div id="primary" class="content-area">
<?php do_action( 'bootscore_after_primary_open', 'page-full-width-image' ); ?>
<main id="main" class="site-main">
<?php $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full'); ?>
<div class="entry-header <?= apply_filters('bootscore/class/featured-full-width-img', 'featured-full-width-img height-75 bg-dark text-light mb-4', 'page-full-width-image'); ?>" style="background-image: url('<?= $thumb['0']; ?>')">
<div class="<?= apply_filters('bootscore/class/container', 'container', 'page-full-width-image'); ?> <?= apply_filters('bootscore/class/featured-full-width-img/container', 'h-100 d-flex align-items-end pb-3', 'page-full-width-image'); ?>">
<div class="<?= apply_filters('bootscore/class/full-width-img-title-wrapper', 'full-width-img-title-wrapper', 'page-full-width-image'); ?>">
<?php do_action( 'bootscore_before_title', 'page-full-width-image' ); ?>
<h1 class="entry-title"><?php get_the_title(get_option('page_for_posts'))?></h1>
<?php do_action( 'bootscore_after_title', 'page-full-width-image' ); ?>
</div>
</div>
</div>
<div class="<?= apply_filters('bootscore/class/container', 'container', 'page-full-width-image'); ?> <?= apply_filters('bootscore/class/content/spacer', 'pb-5', 'page-full-width-image'); ?>">
<?php do_action( 'bootscore_after_featured_image', 'page-sidebar-none' ); ?>
<div class="entry-content">
<?php the_content(); ?>
</div>
<?php do_action( 'bootscore_before_entry_footer', 'page-sidebar-none' ); ?>
<div class="entry-footer">
<?php comments_template(); ?>
</div>
</main>
</div>
</div>
<?php
get_footer();

View File

@@ -11,7 +11,7 @@
?> ?>
<div <?php echo get_block_wrapper_attributes(); ?> <div <?php echo get_block_wrapper_attributes(); ?>
style="background-image: url(<?php echo wp_get_attachment_image_url($attributes['backgroundImage'], size= = "large"); ?>" style="background-image: url(<?php echo wp_get_attachment_image_url($attributes['backgroundImage'], $size = "large"); ?>"
tabindex="0"> tabindex="0">
<div class="call-to-action"> <div class="call-to-action">

View File

@@ -11,7 +11,7 @@
?> ?>
<div <?php echo get_block_wrapper_attributes(); ?> <div <?php echo get_block_wrapper_attributes(); ?>
style="background-image: url(<?php echo wp_get_attachment_image_url($attributes['backgroundImage'], size= = "large"); ?>" style="background-image: url(<?php echo wp_get_attachment_image_url($attributes['backgroundImage'], $size = "large"); ?>"
tabindex="0"> tabindex="0">
<div class="call-to-action"> <div class="call-to-action">