🍬 WordPress child theme for Septera and Bravada https://habd.as/site/chicago-gang-history-iii/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
4.5 KiB

<?php
// Update global site footer for Comfusion
function valkyrie_master_footer () {
cryout_footer_hook();
echo '<div id="footer-separator"></div>';
echo '<div id="site-copyright">' . wp_kses_post( cryout_get_option( 'septera_copyright' ) ) . '</div>';
echo '<div style="display:block;float:right;clear: right;font-size: .85em;font-weight: bold; text-transform: uppercase;">' . __( "Powered by", "septera" ) . ' ' .
'<a target="_blank" rel="noopener nofollow" href="https://habd.as/">' . "habd.as" . '</a>' . ' &amp; ';
echo '<a target="_blank" rel="noopener" href="https://cryoutcreations.eu/wordpress-themes/septera"';
echo 'title="' . esc_attr__( "Septera WordPress Theme by ' . 'Cryout Creations", "septera") . '"> ' . sprintf( " %s.", "Septera" ) . '</a></div>';
cryout_after_footer_hook();
}
// AdSense code for CGH-II page-level ads
// Disables referrer for external requests, which is a bit heavy
// given the `referrerpolicy` attribute could be used on the `img`
// tag this is good enough for now as it's more obfuscated.
function valkyrie_header () { ?>
<meta name="referrer" content="same-origin">
<!-- Global ad client - Google AdSense -->
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-0000000000000000",
enable_page_level_ads: true
});
</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>
<?php
}
/**
* First override to allow external header images
*/
function septera_header_image() {
global $post;
$header_image = septera_header_image_url();
if ( is_front_page() || ! has_post_thumbnail( $post->ID ) ) {
$header_image = 'https://bit.ly/2GObZPC';
}
if ( is_front_page() && function_exists( 'the_custom_header_markup' ) && has_header_video() ) {
the_custom_header_markup();
} elseif ( ! empty( $header_image ) ) { ?>
<div class="header-image" <?php echo cryout_echo_bgimage( esc_url( $header_image ) ) ?>></div>
<img class="header-image" alt="<?php if ( is_single() ) the_title_attribute(); elseif ( is_archive() ) echo strip_tags( get_the_archive_title() ); else echo get_bloginfo( 'name' ) ?>" src="<?php echo esc_url( $header_image ) ?>" />
<?php cryout_header_widget_hook(); ?>
<?php };
} // septera_header_image()
/**
* Second override to allow external header image
*/
function septera_lpslider_output( $data ) {
extract($data);
if ( is_front_page() ) {
$image = 'https://bit.ly/2GObZPC';
} ?>
<section class="lp-staticslider">
<?php if ( ! empty( $image ) ) { ?>
<img class="lp-staticslider-image" alt="<?php echo esc_attr( $title ) ?>" src="<?php echo esc_url( $image ); ?>">
<?php } ?>
<div class="staticslider-caption">
<?php if ( ! empty( $title ) ) { ?> <h2 class="staticslider-caption-title"><?php echo do_shortcode( wp_kses_post( $title ) ) ?></h2><?php } ?>
<?php if ( ! empty( $title ) && ! empty( $content ) ) { ?><span class="staticslider-sep"></span><?php } ?>
<?php if ( ! empty( $content ) ) { ?> <div class="staticslider-caption-text"><?php echo do_shortcode( wp_kses_post( $content ) ) ?></div><?php } ?>
<?php if ( ! empty( $lpslidercta1text ) ) { echo '<a class="staticslider-button-1" href="' . esc_url( $lpslidercta1link ) . '">' . esc_html( $lpslidercta1text ) . '</a>'; } ?>
<?php if ( ! empty( $lpslidercta2text ) ) { echo '<a class="staticslider-button-2" href="' . esc_url( $lpslidercta2link ) . '">' . esc_html( $lpslidercta2text ) . '</a>'; } ?>
</div>
</section><!-- .lp-staticslider -->
<?php
} // septera_lpslider_output()
// Main function to override parent actions
function override_parent_actions () {
add_action( 'cryout_header_hook', 'valkyrie_header' );
remove_action( 'cryout_master_footer_hook', 'septera_master_footer' );
add_action( 'cryout_master_footer_hook', 'valkyrie_master_footer' );
}
add_action( 'init', 'override_parent_actions' );
/**
* Enable Page excerpts
*
* When Pages are used as Featured Icon Blocks page excerpts
* allow more control over content presented to users.
*
* @return void
*/
function enable_page_excerpt () {
add_post_type_support( 'page', array('excerpt') );
}
add_action( 'init', 'enable_page_excerpt' );