add page-sidebar-none template

This commit is contained in:
Nataliia Bobrova 2025-03-05 17:46:50 +00:00
parent 1e1ce272a6
commit c7bb2d5cc5
2 changed files with 69 additions and 2 deletions

View File

@ -226,8 +226,19 @@ add_action( 'init', 'register_list_block_popout' );
/**
* 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";
}
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);

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' ); ?>
<?php the_title('<h1 class="entry-title ' . apply_filters('bootscore/class/entry/title', '', 'page-full-width-image') . '">', '</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();