Page Menu
Home
GitPull.it
Search
Configure Global Search
Log In
Files
F15178448
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Unknown
Size
4 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/functions.php b/functions.php
index d32dc24..ac5c81f 100644
--- a/functions.php
+++ b/functions.php
@@ -1,76 +1,80 @@
<?php
/**
* OnAir2 Child theme
* custom functions.php file
*/
//wp_register_style( 'borderradio-custom', get_template_directory_uri() . '/script.css' );
+// Homepage: allow to change the splash screen
+// https://gitpull.it/T581
+define( 'ONAIR2_HOMEPAGE_SPLASH_IMG', '/wp-content/uploads/2020/04/MarasmaGenerale-1024x724.jpeg' );
+
/**
* Add parent and child stylesheets
*/
add_action( 'wp_enqueue_scripts', 'qantumthemes_child_enqueue_styles' );
if(!function_exists('qantumthemes_child_enqueue_styles')) {
function qantumthemes_child_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style', get_stylesheet_uri() );
// wp_enqueue_script( 'borderradio-custom' );
}}
/**
* Upon activation flush the rewrite rules to avoid 404 on custom post types
*/
add_action( 'after_switch_theme', 'qantumthemes_child_rewrite_flush_child' );
if(!function_exists('qantumthemes_child_rewrite_flush_child')) {
function qantumthemes_child_rewrite_flush_child() {
flush_rewrite_rules();
}}
/**
* Setup Onair2 Child Theme's textdomain.
*
* Declare textdomain for this child theme.
* Translations can be filed in the /languages/ directory.
*/
function qantumthemes_child_theme_setup() {
load_child_theme_textdomain( 'onair2-child', get_stylesheet_directory() . '/languages' );
}
add_action( 'after_setup_theme', 'qantumthemes_child_theme_setup' );
/**
* Customize how posts are queried
*/
add_filter( 'pre_get_posts', function( $query ) {
if( !is_admin() && $query->is_main_query() ) {
/**
* Display all the Speakers in one single page
*
* See https://gitpull.it/T162
* See https://gitpull.it/T178
*/
if ( is_tax( 'membertype' ) ) {
$query->set( 'nopaging', true );
/**
* Increase Podcasts per page
*
* See https://gitpull.it/T160
* See https://gitpull.it/T178
*
*/
} elseif( is_post_type_archive( 'podcast' ) || is_tax( 'podcastfilter' ) ) {
$query->set( 'posts_per_archive_page', 16 );
}
}
} );
// Allow SVG upload in Border Radio website
// https://gitpull.it/T591
add_filter( 'upload_mimes', function( $mimes ) {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
} );
diff --git a/phpincludes/part-background-image-header.php b/phpincludes/part-background-image-header.php
index 8bd4398..f07ed8d 100644
--- a/phpincludes/part-background-image-header.php
+++ b/phpincludes/part-background-image-header.php
@@ -1,54 +1,64 @@
<?php
/*
Package: OnAir2
Description: Header background from page or customizer
Version: 0.0.0
Author: QantumThemes
Author URI: http://qantumthemes.com
*/
if( (is_singular() || is_home() || is_front_page()) && has_post_thumbnail()){
?>
- <div class="qt-header-bg" data-bgimage="<?php echo the_post_thumbnail_url( 'qantumthemes-xl' ); ?>" data-bgattachment="" data-parallax="1">
+ <div class="qt-header-bg" data-bgimage="<?php
+
+ // Homepage: allow to change the splash screen
+ // https://gitpull.it/T581
+ if( is_front_page() ) {
+ echo htmlspecialchars( ONAIR2_HOMEPAGE_SPLASH_IMG );
+ } else {
+ the_post_thumbnail_url( 'qantumthemes-xl' );
+ }
+
+ ?>" data-bgattachment="" data-parallax="1">
</div>
<?php
} else {
$image_from_customizer = get_theme_mod( 'qt_header_backgroundimage', '' );
/**
* since 1.9.9 // updated in 2.0.5
* Check for custom background addable via QT custom category plugin
*/
if(is_category() || is_tax('podcastfilter') || is_tax('eventtype')){
if(is_category()){
// $category = get_category( get_query_var( 'cat' ) );
$catid = get_query_var( 'cat' );
}
/**
* since 2.0.5 // support for custom images in podcast categories
*/
if(is_tax('podcastfilter')){
$slug = get_query_var( 'podcastfilter' );
$term = get_term_by('slug', $slug, 'podcastfilter');
$catid = $term->term_id;
} else if(is_tax('eventtype')){
$slug = get_query_var( 'eventtype' );
$term = get_term_by('slug', $slug, 'eventtype');
$catid = $term->term_id;
}
if(!empty( $catid)){
$image_id = get_term_meta($catid, 'qt_category_img_id', true);
if($image_id){
$image_from_customizer = wp_get_attachment_url ( $image_id, 'full' );
}
}
}
if($image_from_customizer != '') {
?>
<div class="qt-header-bg" data-bgimage="<?php echo esc_url($image_from_customizer); ?>" data-bgattachment="" data-parallax="1">
</div>
<?php
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Thu, Nov 19, 04:27 (19 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2264741
Default Alt Text
(4 KB)
Attached To
Mode
R26 Border Radio OnAir2 child theme
Attached
Detach File
Event Timeline