scanthe17

code

Aug 22nd, 2018
292
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. * Your code goes below
  3. */
  4.  
  5. /**
  6. * The template for displaying the Promotion Headline
  7. *
  8. * @package Decree Pro
  9. */
  10.  
  11.  
  12. if ( ! function_exists( 'decree_promo_head_display' ) ) :
  13. /**
  14. * Add Promotion Headline.
  15. *
  16. * @uses action hook decree_before_content
  17. *
  18. * @since Decree Pro 1.0
  19. */
  20. function decree_promo_head_display() {
  21. //decree_flush_transients();
  22. $output = '';
  23.  
  24. $options = decree_get_theme_options();
  25. $enable_content = $options['promo_head_option'];
  26. $content_select = $options['promo_head_type'];
  27.  
  28. if ( decree_check_section( $enable_content ) ) {
  29. if ( ! $output = get_transient( 'decree_promotion_headline' ) ) {
  30. echo '<!-- refreshing cache -->';
  31.  
  32. $classes[] = $content_select ;
  33.  
  34. $output ='
  35. <div id="promotion-headline-section" class="sections ' . implode( ' ', $classes ) . '">
  36. <div class="wrapper">';
  37. // Select content
  38. if ( 'demo' === $content_select ) {
  39. $output .= decree_demo_promotion_headline();
  40. }
  41. elseif ( 'post' === $content_select || 'page' === $content_select || 'category' === $content_select ) {
  42. $output .= decree_post_page_category_promotion_headline( $options );
  43. }
  44. elseif ( 'custom' === $content_select ) {
  45. $output .= decree_custom_promotion_headline( $options );
  46. }
  47.  
  48. $output .= '
  49. </div><!-- .wrapper -->
  50. </div><!-- #promotion-section -->';
  51.  
  52. }
  53.  
  54. set_transient( 'decree_promotion_headline', $output, 86940 );
  55. }
  56. echo $output;
  57. }
  58. endif;
  59. add_action( 'decree_footer', 'decree_promo_head_display', 30 );
RAW Paste Data