Skip to content

Commit

Permalink
Merge pull request #1 from bulhakovolexii/university-extra-feat
Browse files Browse the repository at this point in the history
Added alternative light palette
  • Loading branch information
bulhakovolexii authored Dec 27, 2024
2 parents 2e53326 + 7180dcd commit fdf9d19
Show file tree
Hide file tree
Showing 7 changed files with 635 additions and 45 deletions.
22 changes: 22 additions & 0 deletions footer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/**
* The template for displaying the footer.
*
* Contains the closing of the #content div and all content after.
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package University_Hub
*/

do_action('university_hub_action_after_content'); ?>

<?php do_action('university_hub_action_before_footer'); ?>
<?php do_action('university_hub_action_footer'); ?>
<?php do_action('university_hub_action_after_footer'); ?>

<?php do_action('university_hub_action_after'); ?>

<?php wp_footer(); ?>
</body>
</html>
40 changes: 39 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ function child_theme_dequeue_parent_styles()
*/
function child_theme_enqueue_styles()
{
wp_enqueue_style(
'child-style',
get_stylesheet_directory_uri() . '/style.css',
[],
filemtime(get_stylesheet_directory() . '/style.css')
);

wp_enqueue_style(
'child-theme-style',
get_stylesheet_directory_uri() . '/css/blocks.css',
Expand All @@ -53,7 +60,7 @@ function child_theme_enqueue_styles()
'6.5.0'
);
}
add_action('wp_enqueue_scripts', 'child_theme_enqueue_styles');
add_action('wp_enqueue_scripts', 'child_theme_enqueue_styles', 20);

/**
* Adding child theme block editor settings.
Expand Down Expand Up @@ -152,6 +159,7 @@ function register_theme_customizer($wp_customize)
'choices' => [
'dark' => 'Dark',
'light' => 'Light',
'light-alternative' => 'Light Alternative',
],
]);
}
Expand Down Expand Up @@ -263,3 +271,33 @@ function khpi_university_hub_custom_content_width()
endif;

add_filter('template_redirect', 'khpi_university_hub_custom_content_width', 20);
/**
* New footer hook
*/

// require_once get_stylesheet_directory_uri() . '/inc/new-footer.php';
require_once get_theme_file_path('inc/new-footer.php');

/**
* Choosing between calendars and thumbnails in News and Events
*/
function khpi_university_hub_customize_register($wp_customize)
{
// Adding a display selection setting to an existing section
$wp_customize->add_setting('home_news_display_style', [
'default' => 'calendar', // Default value
'sanitize_callback' => 'sanitize_text_field', // Data verificationх
]);

// Adding a control to the section_home_news_and_events section
$wp_customize->add_control('home_news_display_style', [
'label' => __('News Display Style', 'university-hub'),
'section' => 'section_home_news_and_events', // Specifying an existing section
'type' => 'radio',
'choices' => [
'calendar' => __('Calendar', 'university-hub'),
'thumbnail' => __('Thumbnail', 'university-hub'),
],
]);
}
add_action('customize_register', 'khpi_university_hub_customize_register');
78 changes: 78 additions & 0 deletions inc/new-footer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?php

if (!function_exists('university_hub_footer_copyright')):
/**
* Footer copyright
*
* @since 1.0.0
*/
function university_hub_footer_copyright()
{
// Check if footer is disabled.
$footer_status = apply_filters(
'university_hub_filter_footer_status',
true
);
if (true !== $footer_status) {
return;
}

// Footer Menu.
$footer_menu_content = wp_nav_menu([
'theme_location' => 'footer',
'container' => 'div',
'container_id' => 'footer-navigation',
'depth' => 1,
'fallback_cb' => false,
'echo' => false,
]);

// Copyright content.
$copyright_text = university_hub_get_option('copyright_text');
$copyright_text = apply_filters(
'university_hub_filter_copyright_text',
$copyright_text
);
if (!empty($copyright_text)) {
$copyright_text = wp_kses_data($copyright_text);
}

// Powered by content.
// $powered_by_text = sprintf( __( 'University Hub by %s', 'university-hub' ), '<a target="_blank" rel="designer" href="https://wenthemes.com/">' . __( 'WEN1 Themes', 'university-hub' ) . '</a>' );

// Social in footer.
$show_social_in_footer = university_hub_get_option(
'show_social_in_footer'
);
?>

<div class="colophon-inner">

<?php if (true === $show_social_in_footer && has_nav_menu('social')): ?>
<div class="colophon-column">
<div class="footer-social">
<?php the_widget('University_Hub_Social_Widget'); ?>
</div><!-- .footer-social -->
</div><!-- .colophon-column -->
<?php endif; ?>


<?php if (!empty($footer_menu_content)): ?>
<div class="colophon-column">
<?php echo $footer_menu_content; ?>
</div><!-- .colophon-column -->
<?php endif; ?>

<?php if (!empty($copyright_text)): ?>
<div class="colophon-column">
<div class="copyright">
<?php echo str_replace('%year%', date('Y'), $copyright_text); ?>
</div><!-- .copyright -->
</div><!-- .colophon-column -->
<?php endif; ?>

</div><!-- .colophon-inner -->

<?php
}
endif;
Loading

0 comments on commit fdf9d19

Please sign in to comment.