WordPress child theme for Septera used on ChicagoGangHistory.com https://chicagoganghistory.com
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.

functions.php 4.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. // Update global site footer for Comfusion
  3. function valkyrie_master_footer () {
  4. cryout_footer_hook();
  5. echo '<div id="footer-separator"></div>';
  6. echo '<div id="site-copyright">' . wp_kses_post( cryout_get_option( 'septera_copyright' ) ) . '</div>';
  7. echo '<div style="display:block;float:right;clear: right;font-size: .85em;font-weight: bold; text-transform: uppercase;">' . __( "Powered by", "septera" ) . ' ' .
  8. '<a target="_blank" rel="noopener nofollow" href="https://comfusion.io/" title="Websites for You and SME">' . "Comfusion" . '</a>' . ' &amp; ';
  9. echo '<a target="_blank" rel="noopener" href="https://cryoutcreations.eu/wordpress-themes/septera"';
  10. echo 'title="' . esc_attr__( "Septera WordPress Theme by ' . 'Cryout Creations", "septera") . '"> ' . sprintf( " %s.", "Septera" ) . '</a></div>';
  11. cryout_after_footer_hook();
  12. }
  13. // AdSense code for CGH-II page-level ads
  14. // Disables referrer for external requests, which is a bit heavy
  15. // given the `referrerpolicy` attribute could be used on the `img`
  16. // tag this is good enough for now as it's more obfuscated.
  17. function valkyrie_header () { ?>
  18. <meta name="referrer" content="same-origin">
  19. <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  20. <script>
  21. (adsbygoogle = window.adsbygoogle || []).push({
  22. google_ad_client: "ca-pub-0082825360919078",
  23. enable_page_level_ads: true
  24. });
  25. </script>
  26. <?php
  27. }
  28. /**
  29. * First override to allow external header images
  30. */
  31. function septera_header_image() {
  32. global $post;
  33. $header_image = septera_header_image_url();
  34. if ( is_front_page() || ! has_post_thumbnail( $post->ID ) ) {
  35. $header_image = 'https://is.gd/rC2cDk';
  36. }
  37. if ( is_front_page() && function_exists( 'the_custom_header_markup' ) && has_header_video() ) {
  38. the_custom_header_markup();
  39. } elseif ( ! empty( $header_image ) ) { ?>
  40. <div class="header-image" <?php echo cryout_echo_bgimage( esc_url( $header_image ) ) ?>></div>
  41. <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 ) ?>" />
  42. <?php cryout_header_widget_hook(); ?>
  43. <?php };
  44. } // septera_header_image()
  45. /**
  46. * Second override to allow external header image
  47. */
  48. function septera_lpslider_output( $data ) {
  49. extract($data);
  50. if ( is_front_page() ) {
  51. $image = 'https://is.gd/rC2cDk';
  52. } ?>
  53. <section class="lp-staticslider">
  54. <?php if ( ! empty( $image ) ) { ?>
  55. <img class="lp-staticslider-image" alt="<?php echo esc_attr( $title ) ?>" src="<?php echo esc_url( $image ); ?>">
  56. <?php } ?>
  57. <div class="staticslider-caption">
  58. <?php if ( ! empty( $title ) ) { ?> <h2 class="staticslider-caption-title"><?php echo do_shortcode( wp_kses_post( $title ) ) ?></h2><?php } ?>
  59. <?php if ( ! empty( $title ) && ! empty( $content ) ) { ?><span class="staticslider-sep"></span><?php } ?>
  60. <?php if ( ! empty( $content ) ) { ?> <div class="staticslider-caption-text"><?php echo do_shortcode( wp_kses_post( $content ) ) ?></div><?php } ?>
  61. <?php if ( ! empty( $lpslidercta1text ) ) { echo '<a class="staticslider-button-1" href="' . esc_url( $lpslidercta1link ) . '">' . esc_html( $lpslidercta1text ) . '</a>'; } ?>
  62. <?php if ( ! empty( $lpslidercta2text ) ) { echo '<a class="staticslider-button-2" href="' . esc_url( $lpslidercta2link ) . '">' . esc_html( $lpslidercta2text ) . '</a>'; } ?>
  63. </div>
  64. </section><!-- .lp-staticslider -->
  65. <?php
  66. } // septera_lpslider_output()
  67. // Main function to override parent actions
  68. function override_parent_actions () {
  69. add_action( 'cryout_header_hook', 'valkyrie_header' );
  70. remove_action( 'cryout_master_footer_hook', 'septera_master_footer' );
  71. add_action( 'cryout_master_footer_hook', 'valkyrie_master_footer' );
  72. }
  73. add_action( 'init', 'override_parent_actions' );
  74. /**
  75. * Enable Page excerpts
  76. *
  77. * When Pages are used as Featured Icon Blocks page excerpts
  78. * allow more control over content presented to users.
  79. *
  80. * @return void
  81. */
  82. function enable_page_excerpt () {
  83. add_post_type_support( 'page', array('excerpt') );
  84. }
  85. add_action( 'init', 'enable_page_excerpt' );