catchresponsive_promotion_headline

Template for Promotion Headline.

Description

catchresponsive_promotion_headline(); 

To override this in a child theme simply create your own catchresponsive_promotion_headline(), and that function will be used instead.


Usage

  1. if ( !function_exists( 'catchresponsive_promotion_headline' ) ) { 
  2. require_once '/inc/catchresponsive-core.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = catchresponsive_promotion_headline(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/inc/catchresponsive-core.php  
  1. function catchresponsive_promotion_headline() { 
  2. //delete_transient( 'catchresponsive_promotion_headline' ); 
  3.  
  4. global $post, $wp_query; 
  5.  
  6. $promotion_headline = $options['promotion_headline']; 
  7. $promotion_subheadline = $options['promotion_subheadline']; 
  8. $promotion_headline_button = $options['promotion_headline_button']; 
  9. $promotion_headline_target = $options['promotion_headline_target']; 
  10. $enablepromotion = $options['promotion_headline_option']; 
  11.  
  12. //support qTranslate plugin 
  13. if ( function_exists( 'qtrans_convertURL' ) ) { 
  14. $promotion_headline_url = qtrans_convertURL($options[ 'promotion_headline_url' ]); 
  15. else { 
  16. $promotion_headline_url = $options[ 'promotion_headline_url' ]; 
  17.  
  18. // Front page displays in Reading Settings 
  19. $page_on_front = get_option( 'page_on_front' ) ; 
  20. $page_for_posts = get_option('page_for_posts'); 
  21.  
  22. // Get Page ID outside Loop 
  23. $page_id = $wp_query->get_queried_object_id(); 
  24.  
  25. if ( ( "" != $promotion_headline || "" != $promotion_subheadline || "" != $promotion_headline_url ) && ( 'entire-site' == $enablepromotion || ( ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) && 'homepage' == $enablepromotion ) ) ) { 
  26.  
  27. if ( !$catchresponsive_promotion_headline = get_transient( 'catchresponsive_promotion_headline' ) ) { 
  28.  
  29. echo '<!-- refreshing cache -->'; 
  30.  
  31. $catchresponsive_promotion_headline = ' 
  32. <div id="promotion-message"> 
  33. <div class="wrapper"> 
  34. <div class="section left">'; 
  35.  
  36. if ( "" != $promotion_headline ) { 
  37. $catchresponsive_promotion_headline .= '<h2>' . $promotion_headline . '</h2>'; 
  38.  
  39. if ( "" != $promotion_subheadline ) { 
  40. $catchresponsive_promotion_headline .= '<p>' . $promotion_subheadline . '</p>'; 
  41.  
  42. $catchresponsive_promotion_headline .= ' 
  43. </div><!-- .section.left -->'; 
  44.  
  45. if ( "" != $promotion_headline_url ) { 
  46. if ( "1" == $promotion_headline_target ) { 
  47. $headlinetarget = '_blank'; 
  48. else { 
  49. $headlinetarget = '_self'; 
  50.  
  51. $catchresponsive_promotion_headline .= ' 
  52. <div class="section right"> 
  53. <a class="promotion-button" href="' . esc_url( $promotion_headline_url ) . '" target="' . $headlinetarget . '">' . esc_attr( $promotion_headline_button ) . ' 
  54. </a> 
  55. </div><!-- .section.right -->'; 
  56.  
  57. $catchresponsive_promotion_headline .= ' 
  58. </div><!-- .wrapper --> 
  59. </div><!-- #promotion-message -->'; 
  60.  
  61. set_transient( 'catchresponsive_promotion_headline', $catchresponsive_promotion_headline, 86940 ); 
  62. echo $catchresponsive_promotion_headline;